User`s guide

7 Functions — Alphabetical List
7-114
Data: 0
RowLimit: 0
SQLQuery: 'select * from productTable'
Message: []
Type: 'ODBCCursor Object'
Statement: [1x1 database.internal.ODBCStatementHandle]
With the native ODBC interface, exec returns curs a database.ODBCCursor object
instead of a Database Cursor Object.
After finishing with the cursor object, close it.
close(curs)
Select Data from a Database Table
Using the dbtoolboxdemo data source, select data from the suppliers table that you
access using the database connection, conn. Assign the SQL statement to the variable
sqlquery. Assign the returned cursor object to the variable curs.
sqlquery = 'select City from suppliers';
curs = exec(conn,sqlquery)
curs =
Attributes: []
Data: 0
DatabaseObject: [1x1 database]
RowLimit: 0
SQLQuery: 'select City from suppliers'
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: 0
After finishing with the cursor object, close it.
close(curs)
Select Data from a Database Table Using a Scrollable Cursor
Using a MySQL database, select data from a table that you access using the native
ODBC database connection conn and create a scrollable cursor.