columnnames - Retrieve names of columns in fetched data set

Syntax

FIELDSTRING = columnnames(CURSOR)
FIELDSTRING = columnnames(CURSOR,BCELLARRAY)

Description

FIELDSTRING = columnnames(CURSOR) returns the column names of the data selected from a database table. The column names are enclosed in quotes and separated by commas.

FIELDSTRING = columnnames(CURSOR,BCELLARRAY) returns the column names as a cell array of strings when BCELLARRAY is set to true.

Examples

  1. Run a SQL query to return all columns from the Microsoft Access Northwind database employees table:

    'select * from employees'
  2. Use columnnames to retrieve all column names for the selected columns:

    fieldString = columnnames(cursor)
    fieldString = 'EmployeeID','LastName','FirstName','Title',
    'TitleOfCourtesy','BirthDate','HireDate','Address',
    'City','Region','PostalCode','Country','HomePhone',
    

See Also

attr, cols, columnprivileges, columns, cursor.fetch, get, width

  


 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS