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

    Unanswered: How to determine the existence of a table in a DB

    Hello ALL,

    I wonder how to determine whether a table has already existed in a database.

    Thanks

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You can determine whether it exists now by querying syscat.tables. I don't think you can determine whether it existed in the past, but has been dropped.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    You can find info about dropped tables in the history file if it hasn't been pruned.

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You can also try to create the table and check for an error code returned by DB2.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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