Home » Infrastructure » Unix » Unix environment variables
Unix environment variables [message #366981] Tue, 07 March 2000 01:55 Go to next message
julz
Messages: 3
Registered: March 2000
Junior Member
Is there an elegant way to make Unix environment variables, such as TZ, available in Oracle? One way is to create a shell script that echoes $TZ > tz.out and then imports tz.out into an Oracle table. Is there a better way?
Re: Unix environment variables [message #366982 is a reply to message #366981] Thu, 09 March 2000 12:17 Go to previous messageGo to next message
ELok
Messages: 5
Registered: November 1998
Junior Member
What exactly are you trying to do with the env. variables?
Re: Unix environment variables [message #366983 is a reply to message #366981] Thu, 09 March 2000 15:34 Go to previous messageGo to next message
julz
Messages: 3
Registered: March 2000
Junior Member
Just trying to see what the timezone (TZ) is.
I cannot find where Oracle has that information defined internally.
Re: Unix environment variables [message #366985 is a reply to message #366981] Sun, 12 March 2000 12:45 Go to previous messageGo to next message
Roshan D'Souza
Messages: 8
Registered: March 2000
Junior Member
Julz,

How bout trying this simple one

Prerequisites are you should have a Oracle table (you can give any name, for the example here I have given the name timezone with a field TZ)

Place this code into a shell script(Remember a shell script and not sql script) and execute it

sqlplus "userid/password" << EOF
insert into timezone(TZ)
values('$TZ');
commit;
exit;
EOF

Let me know if it works.
Re: Unix environment variables [message #366988 is a reply to message #366985] Mon, 13 March 2000 15:10 Go to previous message
julz
Messages: 3
Registered: March 2000
Junior Member
Thanks! That does work.
The main problem with shell scripts is how and when do they get executed so that the TZ column is always up to date.
Previous Topic: Re: Oracle internal error codes
Next Topic: profiled executables core dump
Goto Forum:
  


Current Time: Thu Jan 21 00:05:21 CST 2021