describe command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • topsyk
    New Member
    • Jul 2007
    • 1

    #1

    describe command

    Is it possible to get just the type length from a describe command in db2?
  • naval123
    New Member
    • Aug 2007
    • 14

    #2
    plz explain ur query....

    Comment

    • Purple
      Recognized Expert Contributor
      • May 2007
      • 404

      #3
      Moved from Articles

      Moderator

      Comment

      • cburnett
        New Member
        • Aug 2007
        • 57

        #4
        I'm assuming you want the field lengths for each of the columns (rather like the Oracle VSIZE function).

        Don't think the DESCRIBE command can do this. However there is a way to get what you require.

        If you are describing a table then:

        Code:
        select colname, length from syscat.columns where tabschema = 'SYSIBM' and tabname = 'SYSTABLES' order by colno
        If you are describing a statement, it's a little more awkward:

        Code:
        create view abc as <select statement>
        
        select colname, length from syscat.columns where tabschema = USER and tabname = 'ABC' order by colno
        
        drop view abc

        Comment

        Working...