Describe AS/400 command

895 pts.
AS/400 commands
'Describe select * from tablename'.
We can use this statement from the DB2 command line , which results the complete definition of the table.
Could you please tell me the same, which I can use from STRSQL, as describe is throwing an error.
Thanks in advance

Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

Select * from (Tablename)
Then F4
Then F$ on the ‘Select fields’ line

Discuss This Question: 7  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • philpl1jb
    54,090 pointsBadges:
    Can i get a straight answer,thus this Describe statement will work with STRSQL? If not is there any other option to get the table definitions using STRSQL .
    895 pointsBadges:
    What should I do with that F4 on that select statement. could u please elaborate .
    895 pointsBadges:
  • philpl1jb

    Straight Answer.  The Describe command you are using is a custom statement.  We don't know what it calls but one way to see the column list in Interactive SQL would be

    to type SELECT * FROM myfile

    Press F4 (Prompt)

    Move cursor to Select fields line and press F4 (Prompt)

    You will see a list of the columns in the file you put in the initial command and can select the columns to work with.


    54,090 pointsBadges:
    Thanks for ur answer Philp.
    But I am expecting something other. My thing is I should get the table/file definitions (column names,length,datatype,etc) & i need to save all those information on a separate file.
    just like describe stmt on Db2clp gives information of a file completely. The same thing I am trying with Native Iseries STRSQL to fetch the table/file  defnitions.
    895 pointsBadges:
  • philpl1jb

    Then perhaps you didn't look here:

    .table_schema as Library
    ,c.character_maximum_length as Length
    ,c.numeric_precision as Precision
    ,c.numeric_scale as Scale
    from sysibm.tables t
    join sysibm.columns c
    on t.table_schema = c.table_schema
    and t.table_name = c.table_name
    where t.table_schema = 'MYLIB'
    and t.table_name = 'MYTABLE'
    order by t.table_name, c.ordinal_position


    54,090 pointsBadges:
    I found the answer what I am looking for. 
    Select * from syscolumns where table_owner='username'.
    This will list all the columns from all the tables along with their definitions that are created under this user.
    we can give this from STRSQL itself.
    895 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: