MATLAB DATABASE TOOLBOX RELEASE NOTES User's Guide Page 489

  • Download
  • Add to my manuals
  • Print
  • Page
    / 684
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 488
database.fetch
7-59
10 1
Import Two Columns of Data and View Information About the Data
Import the InvoiceNumber and Paid columns from the Invoice table in the
dbtoolboxdemo database.
conn = database('dbtoolboxdemo','','');
setdbprefs('DataReturnFormat','cellarray')
results = fetch(conn,['select InvoiceNumber, '...
'Paid from Invoice']);
View the size of the cell array into which the results were returned.
size(results)
ans =
12 2
View the results for the first row of data.
results(1,:)
ans =
[2101] [0]
View the data type of the second element in the first row of data.
class(results{1,2})
ans =
logical
“ Retrieve Image Data Types”
More About
Tips
You call the database.fetch function with fetch rather than database.fetch.
You implicitly call database.fetch by passing a database object, conn, to fetch.
The fetch function also works with a cursor object. See cursor.fetch.
Page view 488
1 2 ... 484 485 486 487 488 489 490 491 492 493 494 ... 683 684

Comments to this Manuals

No comments