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

  • 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 446
columnnames
7-17
'SupplierNumber','SupplierName','City','Country','FaxNumber'
columnlist contains one long string with the column names in the suppliers table in
quotes and separated by commas.
After finishing with the cursor object, close it.
close(curs)
Close the database connection.
close(conn)
Return Column Names as a Cell Array
Create a database connection conn using the dbtoolboxdemo data source.
conn = database('dbtoolboxdemo','','');
Working with the dbtoolboxdemo data source, use fetch to import all data into
Database Cursor Object curs. Store the data in a cell array contained in the cursor
object field curs.Data.
curs = exec(conn,'select * from productTable');
curs = fetch(curs);
Return the column names in the suppliers table as a cell array.
columnlist = columnnames(curs,true)
columnlist =
'SupplierNumber'
'SupplierName'
'City'
'Country'
'FaxNumber'
columnlist contains a cell array of the column names in the suppliers table. The cell
array has five rows for each column name.
After finishing with the cursor object, close it.
close(curs)
Close the database connection.
Vue de la page 446
1 2 ... 442 443 444 445 446 447 448 449 450 451 452 ... 683 684

Commentaires sur ces manuels

Pas de commentaire