columns - Returns database table column names

Syntax

l = columns(dbmeta, 'cata')
l = columns(dbmeta, 'cata', 'sch')
l = columns(dbmeta, 'cata', 'sch', 'tab')

Description

Examples

  1. Run columns, passing it the following arguments:

    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 in dbmeta, and cell arrays containing the column names in each table.

  2. View the column names for the BONUS table:

    l{1,2}
    ans = 
        'ENAME'    'JOB'    'SAL'    'COMM'
    

See Also

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

  


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