User`s guide

7 Functions — Alphabetical List
7-202
1x2 array of cursor objects
The SQL script has two queries, and returns two results when executed.
Display the results for the second query.
results(2)
ans =
Attributes: []
Data: {4x6 cell}
DatabaseObject: [1x1 database]
RowLimit: 0
SQLQuery: [1x309 char]
Message: ''
Type: 'Database Cursor Object'
ResultSet: [1x1 sun.jdbc.odbc.JdbcOdbcResultSet]
Cursor: [1x1 com.mathworks.toolbox.database.sqlExec]
Statement: [1x1 sun.jdbc.odbc.JdbcOdbcStatement]
Fetch: [1x1 com.mathworks.toolbox.database.fetchTheData]
Display the resultset returned for the second query.
results(2).Data
ans =
'Painting Set' 'Terrific Toys' 'London' [3000] [2400] [1800]
'Victorian Doll' 'Wacky Widgets' 'Adelaide' [1400] [1100] [ 981]
'Sail Boat' 'Incredible Machines' 'Dublin' [3000] [2400] [1500]
'Slinky' 'Doll's Galore' 'London' [3000] [1500] [1000]
Get the column names for the data returned by the second query.
names = columnnames(results(2))
names =
'productDescription','supplierName','city','Jan_Sales','Feb_Sales','Mar_Sales'
Close the cursor array and connection.
close(results)
close(conn)
Run SQL Script in Row Increments
Run SQL commands from a file on a connected data source in two-row increments.