User`s guide
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.