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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: ksh unix variable on cmd line

Re: ksh unix variable on cmd line

From: Barbara Baker <barb.baker_at_gmail.com>
Date: Fri, 5 Aug 2005 10:31:47 -0600
Message-ID: <47a6f72b05080509311d178e72@mail.gmail.com>


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-l
Received on Fri Aug 05 2005 - 11:33:47 CDT

Original text of this message

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