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

  • 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 655
7 Functions — Alphabetical List
7-226
setdbprefs('DataReturnFormat','structure')
Import data into the MATLAB workspace.
curs = exec(conn,...
'select productnumber,productdescription from producttable');
curs = fetch(curs,3);
curs.Data
ans =
productnumber: [3x1 double]
productdescription: {3x1 cell}
Resulting data displays as a structure.
View the contents of the structure curs.Data to see the data.
curs.Data.productdescription
curs.Data.productnumber
ans =
'Victorian Doll'
'Train Set'
'Engine Kit'
ans =
9
8
7
Close the connection.
close(conn)
Change the Write Format for NULL Numbers
Changing the write format for NULL numbers allows the insertion of a NaN as a NULL in
the database.
Establish connection conn to a MySQL database with user name username and
password pwd. This database contains the table inventoryTable with these columns:
productNumber, Quantity, Price, and inventoryDate.
Vue de la page 655
1 2 ... 651 652 653 654 655 656 657 658 659 660 661 ... 683 684

Commentaires sur ces manuels

Pas de commentaire