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

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

ksh unix variable on cmd line

From: Barbara Baker <barb.baker_at_gmail.com>
Date: Fri, 5 Aug 2005 09:44:43 -0600
Message-ID: <47a6f72b05080508447efa19b8@mail.gmail.com>


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.

$ more test.sh
#!/bin/ksh

. /oracle/set_environ.sh
export SDAT=SYSDATE
echo $SDAT

sqlplus user/pwd $SDAT << EOF
select '&1' from dual;
exit
EOF
exit

./test.sh
Current oracle_home is /oracle/app/oracle/product/10g SYSDATE
Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]

where <option> ::= -H | -V | [ [-C <v>] [-L] [-M <o>] [-R <n>] [-S] ]

<logon> ::= <username>[/<password>][@<connect_identifier>] | / | /NOLOG
<start> ::= @<URL>|<filename>[.<ext>] [<parameter> ...]
"-H" displays the SQL*Plus version banner and usage syntax . . . . .
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 05 2005 - 10:46:46 CDT

Original text of this message

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