MATLAB DATABASE TOOLBOX RELEASE NOTES Guida Utente Pagina 489

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 684
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 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.
Vedere la pagina 488
1 2 ... 484 485 486 487 488 489 490 491 492 493 494 ... 683 684

Commenti su questo manuale

Nessun commento