User`s guide
6 Using Database Toolbox Functions
6-44
curs = fetch(curs)
curs =
Attributes: []
Data: [3x5 table]
DatabaseObject: [1x1 database]
RowLimit: 0
SQLQuery: '{call getSupplierInfo('New York')}'
Message: []
Type: 'Database Cursor Object'
ResultSet: [1x1 com.microsoft.sqlserver.jdbc.SQLServerResultSet]
Cursor: [1x1 com.mathworks.toolbox.database.sqlExec]
Statement: [1x1 com.microsoft.sqlserver.jdbc.SQLServerStatement]
Fetch: [1x1 com.mathworks.toolbox.database.fetchTheData]
curs contains the supplier data from calling the stored procedure, getSupplierInfo,
in table format.
Display the supplier data in table format by accessing the contents of the Data element
of curs.
curs.Data
ans =
SupplierNumber SupplierName City
-------------- ------------------ ----------
1001 'Wonder Products' 'New York'
1006 'ACME Toy Company' 'New York'
1012 'Aunt Jemimas' 'New York'
Country FaxNumber
--------------- --------------
'United States' '212 435 1617'
'United States' '212 435 1618'
'USA' '14678923104'
Close the Database Connection
Close the cursor object and the database connection.
close(curs)