IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need a query to view all the tables present in the database


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Mon Sep 24, 2007 5:33 pm
Reply with quote

hi!
i have created some 20 tables i Need a query by which I can view all the tables present in the database.
can anyone help me out.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Sep 24, 2007 5:55 pm
Reply with quote

Hi there,

U can use following query

Code:
SELECT NAME                 
FROM SYSIBM.SYSTABLES       
WHERE DBNAME LIKE ('CC1M%');


Here it will show name of all the tables for database CC1M.Please change database name according to ur requirement
Back to top
View user's profile Send private message
mbr_raja

New User


Joined: 15 Nov 2004
Posts: 26
Location: Chennai, India

PostPosted: Wed Sep 26, 2007 5:37 pm
Reply with quote

select * from sysibm.systables where type = 't' and database = 'first' and
tablespace = 'second';

you have to give exactly the database and tablespace while running the query.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts SET PATH in View DDL DB2 2
No new posts What database does Jobtrac use CA Products 4
No new posts Dynamically pass table name to a sele... DB2 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top