Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Querying environment variables

Re: Querying environment variables

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Mon, 4 Dec 2006 15:07:19 +0100
Message-ID: <45742b3e$0$49208$14726298@news.sunsite.dk>


> On Dec 4, 12:40 pm, "stever" <steve.rainb..._at_mssint.com> wrote:
>> Is it possible from inside a pl/sql block to query the environment
>> variables that were set when the database was started?
>>
>> I don' t beleive I am the only person who has asked this, but cannot
>> find the answer anywhere.

[...]

"stever" <steve.rainbird_at_mssint.com> wrote in message news:1165239654.317628.43510_at_73g2000cwn.googlegroups.com...
> Thanks to Laurnet in the oracle forums I have the following solution
>
> SQL> var f varchar2(40)
> SQL> set autop on
> SQL> exec dbms_system.get_env('PWD',:f)
[...]

That's your client env, not the server env:

$ . oraenv
ORACLE_SID = [oracle] ? ora1022
$ /usr/ucb/ps auxwwe | sed -n
'/[o]ra_smon_ora1022/s/\(.*\)\(TZ=...\)\(.*\)/\2/p' TZ=MET
$ export TZ=GMT
$ printf "%s\n" "set lines 10" "var f varchar2(40)" "set autop on" \
> "exec dbms_system.get_env('TZ',:f)" |
> sqlplus -s / as sysdba

PL/SQL procedure successfully completed.

F



GMT Regards
Dimitre Received on Mon Dec 04 2006 - 08:07:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US