MATLAB DATABASE TOOLBOX RELEASE NOTES Guide de l'utilisateur Page 397

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 684
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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 =
Vue de la page 396
1 2 ... 392 393 394 395 396 397 398 399 400 401 402 ... 683 684

Commentaires sur ces manuels

Pas de commentaire