MATLAB DATABASE TOOLBOX RELEASE NOTES User's Guide Page 573

  • Download
  • Add to my manuals
  • Print
  • Page
    / 684
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 572
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 =
Page view 572
1 2 ... 568 569 570 571 572 573 574 575 576 577 578 ... 683 684

Comments to this Manuals

No comments