
May 14th, 2004, 06:00 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Problem with different environments
Hi at all,
i am actually migrating Cobol-Programs to the PC-side. Some of them had DB2-Access which should be changed now in Oracle-Access.
Now I have a big problem.
We have different environments like Test or Production in which the same tables are stored, like Test.table1 or Prod.table1.
In Cobol you only had to write a select statement like:
select * from table1, in the JCL you could give over a DB2Plan information about on which environment you work, so he knew if to take Table1 from Test or from Production.
Now the tables are stored in Oracle and I connect over ODBC. The problem is that now I have to write the full qualifier in the select statement, like select * from test.table1 or select * from prod.table1 or i get an error message.
Further in embedded sql which is used i can't use a variable after the from-clause.
But the program must be able to connect to different environments without changes, the only solution i can think of in the moment is to write each statement several times for every prefix which can appear. This is very ugly and stupid.
I either don't want to use dynamic Sql because I know the tables, i just don't know the environment.
Is there a way to set a prefix which is automatically set before the tables or any other solution. I am a totally newbie in Oracle, i searched the whole morning the Inet but don't really know for what to search for.
I would be thankful for any suggestion.
Btw please excuse the bad english.
|