User`s guide
7 Functions — Alphabetical List
7-38
ans =
'Victorian Doll'
'Train Set'
'Engine Kit'
Rerun the fetch function to return the second three rows of data.
curs = fetch(curs,3);
View the data.
curs.Data
ans =
'Painting Set'
'Space Cruiser'
'Building Blocks'
Close the cursor object.
close(curs)
Import Rows Iteratively Until You Retrieve All Data
Working with the dbtoolboxdemo data source, use the rowLimit argument to retrieve
the first two rows of data, and then rerun the import using a while loop, retrieving
two rows at a time. Continue until you have retrieved all data, which occurs when
curs.Data is 'No Data'.
curs = exec(conn,'select productdescription from producttable');
% Initialize rowLimit
rowLimit = 2
% Check for more data. Retrieve and display all data.
while ~strcmp(curs.Data,'No Data')
curs = fetch(curs,rowLimit);
curs.Data(:)
end
rowLimit =
2