MATLAB DATABASE TOOLBOX RELEASE NOTES Podręcznik Użytkownika Strona 489

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 684
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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.
Przeglądanie stron 488
1 2 ... 484 485 486 487 488 489 490 491 492 493 494 ... 683 684

Komentarze do niniejszej Instrukcji

Brak uwag