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

  • 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 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.
Zobrazit stránku 446
1 2 ... 442 443 444 445 446 447 448 449 450 451 452 ... 683 684

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

Žádné komentáře