Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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    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

Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

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: 9
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: 1439
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: 9
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: 295
Location: Singapore

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: 10210
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: 295
Location: Singapore

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us