If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to eliminate System tables in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-09, 14:34
swati malla swati malla is offline
Registered User
 
Join Date: Jul 2009
Posts: 26
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
Reply With Quote
  #2 (permalink)  
Old 07-13-09, 15:59
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #3 (permalink)  
Old 07-13-09, 16:59
swati malla swati malla is offline
Registered User
 
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....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On