MATLAB DATABASE TOOLBOX RELEASE NOTES Guia do Utilizador Página 397

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 684
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 =
Vista de página 396
1 2 ... 392 393 394 395 396 397 398 399 400 401 402 ... 683 684

Comentários a estes Manuais

Sem comentários