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

how to bind a table in a different collid


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

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Tue Jan 22, 2013 8:09 pm
Reply with quote

Hi All,

Good morning. I know I will get severe beatings from you for asking this trivial question. I searched the site but was not very sure I found the answer so posting this query

I have a table called TABLEA which is in collid called COLLIDA
and then I have program called PRGMB which has references to tables
TABLE B, TABLE C and TABLE D which are all in another collid called COLLIDB and also has a reference to the TABLEA in COLLIDA
Now, when I am binding this with COLLID (QUALIFIER) as COLLIDB, I am getting a bind error, as the bind is not able to find TABLEA in COLLIDB.

Could you please let me know if there is way to bind tables in two different COLLID using the same BIND?

Thanks a many for the help in advance
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jan 22, 2013 8:32 pm
Reply with quote

Is COLLID you mean here is a collection id or qualifier?
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Tue Jan 22, 2013 8:46 pm
Reply with quote

I am sorry I need to rephrase my question...
Its qualifier!!
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Jan 22, 2013 9:23 pm
Reply with quote

It depends on your site-standards :
you can hardcode the qualifier for one of the tables in the program
i.e. "select * from tableA, QualB.TableB " and then bind with QualA.

Another way is to define an alias :
CREATE ALIAS QualA.QBTableB for QualB.TableB
select * from tableA, QBTableB
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Tue Jan 22, 2013 9:29 pm
Reply with quote

Thanks GuyC,

I will run the bind with the first option that you have specified and will share my results.

If that fails, then I have to turn back to my DBAs to create the alias for all the necessary collections.

Thanks,
Ravi
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Jan 22, 2013 11:11 pm
Reply with quote

As per me COLLID is associated with your package name. And all the packages consists of COBOL-DB2 programs.

Quote:
I have a table called TABLEA which is in collid called COLLIDA


This is something not very true, as tables are not dependent on your COLLID.
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Wed Jan 23, 2013 12:00 am
Reply with quote

Yes Rohit, I agree!! I think in my second note I stated that its not a collection ID but it is a qualifier.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Jan 23, 2013 1:13 am
Reply with quote

Quote:
I am sorry I need to rephrase my question...
Its qualifier!!


Quote:
COLLID(QUALIFIER)
<<< I think you reffered to this one. icon_smile.gif

Code:
BIND PACKAGE (ABCDEV1)  -   
  MEMBER (ABCBD555) -       
  ACTION (REPLACE)    -     
  OWNER  (X@ABCT1) -         
  QUALIFIER (DBTEST) -     
  CURRENTDATA (YES)   -     
  RELEASE(DEALLOCATE) -     
  VALIDATE  (BIND)    -     
  EXPLAIN (NO)     


looking to above card,
I have not seen you reffered to "QUALIFIER", hence I thought to make it clear, as in all your post you have mentioned collection ID.

But GuyC has provided you the options and should work, but generally DBA's creates tables for whatever schema's/qualifier you need and this is needed just to make your own testing and not to play with someone else data in the same table.

All the best.
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Wed Jan 23, 2013 1:19 am
Reply with quote

Hi Rohit,

Sorry to confuse you, may be I was lost in the third world!!

I truly agree with you that its

QUALIFIER (DBTEST) -

that I was mentioning. And as GuyC suggested I am hardcoding the qualifier in the source code and will then bind the program.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Jan 23, 2013 1:55 am
Reply with quote

Just make sure that the hard coded qualifier exists in all DB2 Subsystems that you will ever Bind to.

It may work in Test Subsystem, but not in Quality or Production Subsystems.
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Wed Jan 23, 2013 2:05 am
Reply with quote

Yes, that qualifier exists in the same DB2 subsystem as the others. And in the prod, the table exists under the same qualifier.

Thanks,
Ravi
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 Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top