Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: ksh unix variable on cmd line
Thanks to Paul, Lora, and Magnus for some great ideas on using
variables (one of my severe weaknesses).
Magnus pointed out that I was over-engineering this just a bit. I can use the variable directly in the sql code without passing it on the command line (see below**)
Thanks for all the help!
Barb
**This works for me now:
export SDAT=SYSDATE
echo $SDAT
sqlplus u/p << EOF
select $SDAT from dual;
exit
EOF
On 8/5/05, Barbara Baker <barb.baker_at_gmail.com> wrote:
> Solaris 9
> Oracle 10.1.0.3
>
> I see a reference (actually on lazydba) to supplying an environment
> variable on the sqlplus command line and referencing it within
> sqlplus. Here's that example:
> Sqlplus username/pwd $unix_variable_name <<END
> Create or replace directory <directory_name> as '&1';
> Exit;
> End
>
> This sure doesn't work for me.
>
> Does anyone see what I'm doing wrong?
> Thanks for any help.
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Aug 05 2005 - 11:33:47 CDT
![]() |
![]() |