Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    38

    Unanswered: Query to get the column names

    Hi,

    I am very very new to DB2. Actually writing on behalf of a friend.

    She has around 10 tables created (user-defined). These get listed under the sysobjects. I would like to know an Query that can be executed in isql that would tell me the names of tables (out of the 10) whose column names match a string say 'val'.

    Thanks,
    Anu_R

  2. #2
    Join Date
    Jun 2003
    Location
    İstanbul
    Posts
    19

    Re: Query to get the column names

    I hope this helps.


    SELECT TBNAME FROM SYSIBM.SYSCOLUMNS WHERE NAME = 'val'
    Kezban

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Query to get the column names

    Adding the schema name/creator name in the select list will be helpful

    If you are using DB2 on Unix/Win as a standard use syscat.columns ...

    Cheers

    Sathyaram




    Originally posted by KezbanB
    I hope this helps.


    SELECT TBNAME FROM SYSIBM.SYSCOLUMNS WHERE NAME = 'val'
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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