Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 14th, 2004, 06:00 AM
token token is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 2 token User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #2  
Old May 14th, 2004, 06:38 AM
token token is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 2 token User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, I could solve the problem by creating synonyms.
That works for me. But if someone had a smarter method I still would be interested to hear it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Problem with different environments


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway