View previous topic :: View next topic
|
Author |
Message |
gireeshsk
New User
Joined: 20 Dec 2005 Posts: 6 Location: chennai
|
|
|
|
Hi
I have a program accessing two tables which are in two different subsystem. is it possible and if yes how can i bind it? |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
gireeshsk,
We can dream of a better world, but alas, I do not think this is possible.
Dave |
|
Back to top |
|
|
ragshere
New User
Joined: 20 Dec 2004 Posts: 70
|
|
|
|
Hi,
If you want to access tables on more than one subsyatem in single program you should have DRDA setup.so that you can create remote aliases on the tables which are not on current subsystem.
It will allow you to access those tables from current subsystem.
and you need to use the alias names in the program not table names.
After bind, you can execute the program which will use the remote alias to access the tables on other subsystem.
Hope you got me.
Regards
Rags |
|
Back to top |
|
|
Gurmeet
New User
Joined: 22 Feb 2006 Posts: 46 Location: Pune
|
|
|
|
Sorry to disappoint you, this cannot be achieved even by using aliases.
A bind creates access path and by specifying alias names we are trying to create access paths of 1 subsystem on to 2nd which is not allowed. |
|
Back to top |
|
|
ragshere
New User
Joined: 20 Dec 2004 Posts: 70
|
|
|
|
Gurmeet,
I didn't understand your concern...But practically this is the only option people use for accessing the tables from different subsystems.
DRDA setup will allow you to query the table on remote system through alias on current system.You will not get problems with bind.
Regards
Rags |
|
Back to top |
|
|
Gurmeet
New User
Joined: 22 Feb 2006 Posts: 46 Location: Pune
|
|
|
|
Rags,
I have a similar setup, the bind doesn't works, it fails with sqlcode -512.
When I try to access table from 1 subsystem only, it works but accessing multiple subsytem tables in the same query doesn't work.
Please advise if the above is possible.
~Gurmeet |
|
Back to top |
|
|
ragshere
New User
Joined: 20 Dec 2004 Posts: 70
|
|
|
|
Gurmeet,
there are some restictions while using remote system tables...
1.we should not give EXPLAIN(YES) while binding...
2.we should not use the remote alias in the join queries
If we query the alias directly in the program, I guess Bind will not fail.
In my project we use like that only.
Better have a look at some DB2 manual for more info about using remote aliases.
Regards
Rags |
|
Back to top |
|
|
Gurmeet
New User
Joined: 22 Feb 2006 Posts: 46 Location: Pune
|
|
|
|
Thanks Rags
Actually, in one of the scenarios we tried using aliases in join queries hence it might have failed.
Thanks for the clarification, it helped me a lot solving a long pending issue.
~Gurmeet |
|
Back to top |
|
|
|