User`s guide

7 Functions — Alphabetical List
7-246
curs.Data
ans =
...
[ 5] [10000] [ 5.5000] '2012-09-14 15:00...'
[ 6] [ 4540] [ 8] '2013-12-25 19:45...'
[ 7] [ 6034] [ 16] '2014-08-06 08:38...'
[ 8] [ 9000] [ 10] '2011-06-18 11:45...'
...
The product with the product number equal to 5 has an updated quantity of 10000 units
and price equal to 5.50. The product with the product number equal to 8 has an updated
quantity of 9000 units and price equal to 10.
After finishing with the cursor object, close it.
close(curs)
Close the database connection.
close(conn)
Roll Back Data After Updating a Record
Create a database connection conn. For example, the following code uses the database
toy_store, user name username, password pwd, server name sname, and port number
123456 to connect to a Microsoft SQL Server database. This database contains the table
inventoryTable that contains these columns: productNumber, Quantity, and Price.
conn = database('toy_store','username','pwd',...
'Vendor','Microsoft SQL Server',...
'Server','sname',...
'portnumber',123456);
Set the AutoCommit flag to off. Any updates you make after turning off this flag do not
commit to the database automatically.
set(conn,'AutoCommit','off')
Display the data in the inventoryTable table before making updates.
curs = exec(conn,'select * from inventoryTable');
curs = fetch(curs);
curs.Data