Database Toolbox    
columns

Get database table column names

Syntax

Description

l = columns(dbmeta, 'cata') returns the list of all column names in the catalog cata, for the database whose database metadata object is dbmeta, where dbmeta was created using dmd.

l = columns(dbmeta, 'cata', 'sch') returns the list of all column names in the schema sch, of the catalog cata, for the database whose database metadata object is dbmeta, where dbmeta was created using dmd.

l = columns(dbmeta, 'cata', 'sch', 'tab') returns the list of columns for the table tab, in the schema sch, of the catalog cata, for the database whose database metadata object is dbmeta, where dbmeta was created using dmd.

Examples

Type

MATLAB returns

In this example:

The results show the names of the five tables and a cell array containing the column names in the tables.

To see the column names for the BONUS table, type

MATLAB returns

which are the column names in the BONUS table.

See Also

attr, bestrowid, cols, columnnames, columnprivileges, dmd, get, versioncolumns


  columnprivileges commit