Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
how to find the base table of an ALIAS ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
esrraju

New User


Joined: 19 Feb 2007
Posts: 8
Location: India

PostPosted: Wed Nov 28, 2007 1:17 pm    Post subject: how to find the base table of an ALIAS ?
Reply with quote

how to find the base table of an ALIAS ?
Back to top
View user's profile Send private message
References
PostPosted: Wed Nov 28, 2007 1:17 pm    Post subject: Re: how to find the base table of an ALIAS ? Reply with quote

Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 159
Location: Pune

PostPosted: Wed Nov 28, 2007 4:03 pm    Post subject:
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: 8
Location: India

PostPosted: Wed Nov 28, 2007 4:35 pm    Post subject: Hi SriHari,
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: 1482
Location: Bangalore,India

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

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

New User


Joined: 19 Feb 2007
Posts: 8
Location: India

PostPosted: Wed Nov 28, 2007 5:04 pm    Post subject: Hi Murali
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: 159
Location: Pune

PostPosted: Wed Nov 28, 2007 5:05 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 2562
Location: italy

PostPosted: Wed Nov 28, 2007 5:32 pm    Post subject: Reply to: how to find the base table of an ALIAS ?
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: 159
Location: Pune

PostPosted: Wed Nov 28, 2007 6:00 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1