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 DB2 find the qualifier of the table during the run time?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Harsha1525

New User


Joined: 22 Dec 2009
Posts: 24
Location: hyderabad

PostPosted: Tue Feb 05, 2013 10:08 am    Post subject: How DB2 find the qualifier of the table during the run time?
Reply with quote

Hi,
In my shop different tables have different qualifiers.
let's say
testing database: TEST1
Table name<--->Qualifier
-------------<---->----------
TABLE11 <------>QUAL11
TABLE22 <------>QUAL22

and database name is different for testing and prod environment.

when ever I write cobol-db2 program I write query like select * from table11;select * from table22;
which means I write query independent of qualifier. got the doubt like how my db2 getting the qualifier during the run time. what I understand is it has to do something with the BIND. and I knew we can give QUALIFIER in BIND option. but in my shop we do not use QUALIFIER option and we use OWNER. during the bind time and run time I use DSN SYSTEM(I give database name here) as a input to IKJEFT01. I feel db2 decide the qualifier either by looking at the database name what ever I am giving in DSN command or it has to get based on OWNER option I give during BIND. can some one help me how exactly db2 getting qualifier name during the run time? it will fill all the gaps

Thank you.
Back to top
View user's profile Send private message

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Tue Feb 05, 2013 12:48 pm    Post subject:
Reply with quote

Hi,

Please refer the below topics from DB2 9 for z/OS: Packages Revisited

2.1.8 OWNER in BIND PACKAGE and BIND PLAN
2.1.10 QUALIFIER in BIND PACKAGE and BIND PLAN
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 186
Location: chennai

PostPosted: Tue Feb 05, 2013 7:45 pm    Post subject: Reply to: How DB2 find the qualifier of the table during the
Reply with quote

Hi Harsha,

Regarding qualifier, please visit the link given by Gnanas. I shall try to clear your doubt regarding database that you have mentioned.
Quote:
I use DSN SYSTEM(I give database name here) as a input to IKJEFT01.

DSN SYSTEM(subsystem-id). It is the ssid of the DB2 subsystem. To my knowledge, you can not give Database name there.

Thanks
Raghunathan
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Feb 05, 2013 8:58 pm    Post subject:
Reply with quote

Quote:
when ever I write cobol-db2 program I write query like select * from table11;select * from table22;


Have you actually done this successfully?

My guess is NO.

The reason is, when the BIND is attempted, it looks for the tables existing for the Qualifier (or Owner is Qualifier is omitted).

If both tables mentioned in your sql do not exist for your qualifier, your Bind will fail.

If this is a homework question, get clarification from your instructor.

If this is a work question, speak with your colleagues or DBA for clarification.
Back to top
View user's profile Send private message
Harsha1525

New User


Joined: 22 Dec 2009
Posts: 24
Location: hyderabad

PostPosted: Wed Feb 06, 2013 10:07 am    Post subject:
Reply with quote

Gnanas N wrote:
Hi,

Please refer the below topics from DB2 9 for z/OS: Packages Revisited

2.1.8 OWNER in BIND PACKAGE and BIND PLAN
2.1.10 QUALIFIER in BIND PACKAGE and BIND PLAN

Thank you. I am going thru this book. I hope it answer all of my queries.
Back to top
View user's profile Send private message
Harsha1525

New User


Joined: 22 Dec 2009
Posts: 24
Location: hyderabad

PostPosted: Wed Feb 06, 2013 11:19 am    Post subject:
Reply with quote

daveporcelan wrote:
Quote:
when ever I write cobol-db2 program I write query like select * from table11;select * from table22;


Have you actually done this successfully?

My guess is NO.

The reason is, when the BIND is attempted, it looks for the tables existing for the Qualifier (or Owner is Qualifier is omitted).

If both tables mentioned in your sql do not exist for your qualifier, your Bind will fail.

If this is a homework question, get clarification from your instructor.

If this is a work question, speak with your colleagues or DBA for clarification.

yes i agree with you. during the bind it look for the qualifier. i am not telling both tables does not exists in qualifier.what exactly we do is, we bind with OWNER(own1).so if qualifier is not mentioned it has to derive from Owner.

Table name<--->Qualifier (creator)
-------------<---->----------
TABLE11 <------>QUAL11
TABLE22 <------>QUAL22
along with above structure I found below .
Alias name<--->Qualifier (creator)
-------------<---->----------
TABLE11 <------>OWN11
TABLE22 <------>OWN22

In the BIND card I give OWNER(OWN11).why I got confusion is like if I have to query table I have to write
select * from QUAL11.TABLE11 but i am giving the OWN11 in my bind card so how it is substituting QUAL11 instead of OWN11. as I mentioned I have alias same as table name. which has qualifier as OWN11. if I think like actually in my application I am firing query on alias not on table I believe all of my questions has answers.isn't it?
and if I read Gnanas shared manual link, I believe I should be fine.
it is not a kind of home work question. if I do not know this information also my application work fine. my intension is I want to fill the gaps in my knowledge.
Thank you.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Feb 06, 2013 6:07 pm    Post subject:
Reply with quote

Quote:
as I mentioned I have alias same as table name. which has qualifier as OWN11. if I think like actually in my application I am firing query on alias not on table I believe all of my questions has answers.isn't it?


You did not mention you had an alias. icon_evil.gif

Leaving this information off completely waisted my time.

This is why I do not respond as often as I could.

This is why other posters get so angry.

Good luck obtaining your knowledge.
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 How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


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