?
Solved

How to access a environment variable using Oracle SQL script (Stored procedure)

Posted on 2009-04-06
3
Medium Priority
?
1,219 Views
Last Modified: 2013-12-18
I have a requirement to obtain the value of a environment variable to differentiate between test and production server and use that as an input for a compiled stored procedure. The client is a windows 2003 server from where i need to take the env variable. the server is a hp-ux server. I don't have access to oracle sys login.

Pls assist. I read some approach, but not sure if it suits my requirements.

0
Comment
Question by:Venkatkp007
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 1500 total points
ID: 24083227
what is the environment variable?

do you simply need to know the host server?

select host_name from v$instance

or

select sys_context('userenv','host') from dual
0
 

Author Closing Comment

by:Venkatkp007
ID: 31567295
thk you!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question