User`s guide
fetch
7-145
curs = exec(conn,'select * from productTable order by productNumber',...
'cursorType','scrollable');
Import the last five products in the data set using the absolute position offset 11.
curs = fetch(curs,'absolutePosition',11);
Display the data for the five products.
curs.Data
ans =
[11] [408143] [1004] [ 11] 'Convertible'
[12] [210456] [1010] [ 22] 'Hugsy'
[13] [470816] [1012] [16.5000] 'Pancakes'
[14] [510099] [1011] [ 19] 'Shawl'
[15] [899752] [1011] [ 20] 'Snacks'
The columns in curs.Data are:
• Product number
• Stock number
• Supplier number
• Unit cost
• Product description
After calling fetch, the position of the cursor is located after the data set.
After finishing with the cursor object, close it.
close(curs)
Import Data with a Row Limit Using the Scrollable Cursor
This example assumes you are connecting to a MySQL database that contains a table
called productTable. This table contains 15 records, where each record represents one
product.
Connect to the MySQL database using the native ODBC interface. This code assumes
you are connecting to a data source named MySQL with user name username and
password pwd.