Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2014

    Unanswered: Fetch values of column from all tables in DB

    I have a common column called "Key" in multiple (like some 100) tables in the DB. I want to extract the value of

    that 'Key' column with the table name with some query to get the result set.
    For E.g Table1 has columns key and ID
    Table 2 has columns key and ID
    Table 3 has columns key and ID

    I want to get a result set which shows the values of the column 'Key' with Table Name also
    Something Like
    Table1 A
    Table1 B
    Table1 C
    Table2 D
    Table2 E
    Table3 F
    Table3 G

    Please help. I am new to DB2 and could not reach this.

  2. #2
    Join Date
    Apr 2006
    Provided Answers: 11
    syscat views can be used to find all info about tables/columns/indexes....
    describe some tables.. and expected the question is more clear
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5-V11 Fundamentals- DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified

Tags for this Thread

Posting Permissions

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