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

how to find the base table of an ALIAS ?


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

New User


Joined: 19 Feb 2007
Posts: 9
Location: India

PostPosted: Wed Nov 28, 2007 1:17 pm
Reply with quote

how to find the base table of an ALIAS ?
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Nov 28, 2007 4:03 pm
Reply with quote

Please try this out
SELECT NAME,TBNAME FROM SYSIBM.SYSTABLES WHERE NAME='Alias name' AND TYPE=’A’;
Back to top
View user's profile Send private message
esrraju

New User


Joined: 19 Feb 2007
Posts: 9
Location: India

PostPosted: Wed Nov 28, 2007 4:35 pm
Reply with quote

Thanks for your response.

This query will give you the Alias name itself, but I want to know that base table on which this Alias is built.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Nov 28, 2007 4:42 pm
Reply with quote

Try SYSCAT.TABLES.
Back to top
View user's profile Send private message
esrraju

New User


Joined: 19 Feb 2007
Posts: 9
Location: India

PostPosted: Wed Nov 28, 2007 5:04 pm
Reply with quote

When I try this query select * from SYSCAT.TABLES ..It says SYSCAT.TABLES could not be found. Please ADVISE.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Nov 28, 2007 5:05 pm
Reply with quote

Murali...I too read somewhere that we can use SYSCAT.TABLES for that. But I tried to do a select on this table and ended up with SQLCODE = -204, ERROR: SYSCAT.TABLES IS AN UNDEFINED NAME.

Raju, Generating the DDL for the alias, will give the Create statement of that alias from which we can check the base table name..I am just trying to check for such a JCL. Will let you know, in case I find it.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 28, 2007 5:32 pm
Reply with quote

what about looking at " SYSIBM.SYSALIASES"
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Nov 28, 2007 6:00 pm
Reply with quote

there is no such table, I beleive. I tried it out only to get another -204.
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 Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top