MATLAB DATABASE TOOLBOX RELEASE NOTES Podręcznik Użytkownika Strona 446

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 684
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 445
7 Functions — Alphabetical List
7-16
columnnames
Retrieve names of columns in fetched data set
Syntax
columnlist = columnnames(curs)
columnlist = columnnames(curs,returnCellArray)
Description
columnlist = columnnames(curs) returns the column names of the data selected
from a database table in the cursor object curs. The columnnames function is not
supported for a cursor object returned by the fetchmulti function.
columnlist = columnnames(curs,returnCellArray) returns the column names
as a cell array of strings when returnCellArray is set to true.
Examples
Return Column Names from the Selected Data
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.
curs = exec(conn,'select * from suppliers');
curs = fetch(curs);
Return the column names in the suppliers table.
columnlist = columnnames(curs)
columnlist =
Przeglądanie stron 445
1 2 ... 441 442 443 444 445 446 447 448 449 450 451 ... 683 684

Komentarze do niniejszej Instrukcji

Brak uwag