User`s guide
fetch
7-143
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'
After finishing with the cursor object, close it.
close(curs)
Import Data Iteratively Using the Cursor Object
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
ans =
'Victorian Doll'
'Train Set'
ans =