Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2007
    Posts
    130

    Unanswered: How to get table's field description for DB2

    Hello ALL,


    I wonder what command can be used to get the description of fields of a table,i.e., info about data type, length of ALL fields in a table.


    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Code:
    describe table myschema.mytable
    or
    Code:
    select colname, typename, length, scale from syscat.columns 
    where tabschema = 'MYSCHEMA' and tabname = 'MYTABLE'

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You can use either DESCRIBE, db2look, or query the syscat tables.

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •