Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    26

    Unanswered: How to eliminate System tables in DB2

    Hello Everyone,

    I am very new to DB2.
    I am successfully able to connect to DB2 from java client.
    By using the following method java.sql.DatabaseMetaData.getSchemas() i was able to retrieve all the schema names under that particular data base.

    now my problem is i have all the system schema's also.
    1)Is there any way to eliminate the systems schema's.(System in the sense those are used by DB2)
    2)Is there any way to eliminate the system tables from a database when you are retrieving the table names from the data base.(System means those are used by DB2)

    I would really appreciate if soem one helps me out here.

    Thanks in advance.

    Regards,
    swati

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I do not see a way to filter out those through databasemetadata. You can however use the system catalog tables and use regular SQL to get what you want.

    Andy

  3. #3
    Join Date
    Jul 2009
    Posts
    26
    Tthanks a lot...
    I have used this query


    SELECT TABSCHEMA, TABNAME, TYPE, COLCOUNT,
    KEYCOLUMNS, KEYINDEXID, KEYUNIQUE
    FROM SYSCAT.TABLES
    WHERE TABSCHEMA NOT LIKE 'SYS%' AND
    TYPE = 'T'
    I got the result thanks a lot....

Posting Permissions

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