Re: unix vs. windows: env variables in sqlplus

From: Gerard H. Pille <ghp_at_skynet.be>
Date: Sun, 27 Jul 2003 11:53:00 +0200
Message-ID: <3F23A0FC.3000006_at_skynet.be>


william milbratz wrote:
> Hi,
>
> Can I access environment variables from sqlplus in OS-neutral fashion?
>
> I couldn't find anything in the official documentation, but I came
> across a post on experts-exchange that suggested I could access
> environment variables in an sqlplus script as follows:
>
> SET FEEDBACK OFF;
> _at_ %TEMP%/gen.sql
> _at_ %TEMP%/gen_ja.sql
> SET FEEDBACK ON;
>
> Turns out it works fine on Windows, but Unix requires the traditional
> '$...' format.
> _at_ $TEMP/gen.sql
>
> I'd like to keep my scripts OS-neutral and stay away from SED simply
> to substitute '$TEMP' with '%TEMP%' and such.
>
> any suggestions?
>
> I'm running 8.1.7
>
> thanks,
>
> bill milbratz

Hallo Bill,

aren't you asking a bit too much? OS-neutral environment variables? I thought the environment was part of the OS, but then I have been on holidays.

Does "_at_ %TEMP%/gen.sql" work? I thought µicro$oft used backslashes, but then ...

Maybe I could try to give some serious advice.

Don't use the OS in your scripts: for this specific problem, you could define "ORACLE_PATH" in the OS, before starting Sqlplus, and add your temporary directory to it. So your script would work on both Whinedoze and (Li|U)n(u|i)x. Received on Sun Jul 27 2003 - 11:53:00 CEST

Original text of this message