MATLAB DATABASE TOOLBOX RELEASE NOTES User's Guide Page 446

  • Download
  • Add to my manuals
  • Print
  • Page
    / 684
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 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 =
Page view 445
1 2 ... 441 442 443 444 445 446 447 448 449 450 451 ... 683 684

Comments to this Manuals

No comments