Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Getting Unix environment variable from SQL or PL/SQL
or you could pass them in as positional parameters
e.g.
VAR1=ABC
VAR2=DEF
sqlplus scott/tiger @testproc $VAR1 $VAR2
then in SQL
SELECT *
FROM test
WHERE test_col1 = &1
AND test_col2 = &2;
Hope this helps
Si
John P. Higgins wrote in message <36B66B03.740940FD_at_deere.com>...
>You need to make your SQL text into a unix 'here script'.
>VARIABLE=ABC
>export VARIABLE
>sqlplus -s <<EOF
>system/manager
>select .....where col = '$VARIABLE';
>EOF
>
>Maverick wrote:
>
>> Hi
>>
>> Does anyone know how to get Unix environment variables from SQL
>> or PL/SQL.
>>
>> Thank you in advance.
>>
>> Please send all comments to: mav_at_ghg.net
>
>
>
Received on Wed Feb 03 1999 - 14:17:08 CST