View previous topic :: View next topic
|
Author |
Message |
Harsha1525
New User
Joined: 22 Dec 2009 Posts: 24 Location: hyderabad
|
|
|
|
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
Harsha1525
New User
Joined: 22 Dec 2009 Posts: 24 Location: hyderabad
|
|
|
|
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 |
|
|
Harsha1525
New User
Joined: 22 Dec 2009 Posts: 24 Location: hyderabad
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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.
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 |
|
|
|