MATLAB DATABASE TOOLBOX RELEASE NOTES Uživatelská příručka Strana 397

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 684
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 396
Display Information About Imported Data
6-55
Display Information About Imported Data
This example shows how to import data and display information about the imported data
using a cursor object.
Alternatively, you can retrieve metadata of cursor objects by creating resultset objects
using resultset. Display information about resultset objects using rsmd. Here,
metadata refers to the information about the cursor object that contains the imported
data after running exec.
Create the Database Connection and Import Data
Create a connection conn using the dbtoolboxdemo data source.
conn = database('dbtoolboxdemo','admin','admin');
Import the first 10 rows of product description data in the column
productDescription from the table productTable.
sqlquery = 'select productDescription from productTable';
curs = exec(conn,sqlquery);
curs = fetch(curs,10);
fetch returns the imported data in the MATLAB variable curs.
Retrieve the Number of Rows in the Imported Data
Retrieve the number of rows numrows using curs.
numrows = rows(curs)
numrows =
10
Retrieve the Number of Columns in the Imported Data
Retrieve the number of columns numcols using curs.
numcols = cols(curs)
numcols =
Zobrazit stránku 396
1 2 ... 392 393 394 395 396 397 398 399 400 401 402 ... 683 684

Komentáře k této Příručce

Žádné komentáře