Database Toolbox | ![]() ![]() |
Get database table column names
Syntax
l = columns(dbmeta, 'cata') l = columns(dbmeta, 'cata', 'sch') l = columns(dbmeta, 'cata', 'sch', 'tab')
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
l = columns(dbmeta,'orcl', 'SCOTT')
l = 'BONUS' {1x4 cell} 'DEPT' {1x3 cell} 'EMP' {1x8 cell} 'SALGRADE' {1x3 cell} 'TRIAL' {1x3 cell}
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
l{1,2}
ans = 'ENAME' 'JOB' 'SAL' 'COMM'
which are the column names in the BONUS
table.
See Also
attr
, bestrowid
, cols
, columnnames
, columnprivileges
, dmd
, get
, versioncolumns
![]() | columnprivileges | commit | ![]() |