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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem with running saqlplus in shell script

Re: Problem with running saqlplus in shell script

From: Pierre Charpenay <pcharpenay_at_unilog.fr>
Date: 2000/04/21
Message-ID: <390035E0.A1B3873@unilog.fr>#1/1

Joe Condle wrote :
>
> ...
> If I call the query from the shell script. The output is fine but I do
> not know how to pass a shell script variable to the sqlplus query. Any
> help would be appreciated.
>
> #!/bin/sh
>
> DOMAIN=$1
> sqlplus esp @lisa.sql <<EOF
> EOF
> exit 0
>

To pass variables, you just has to put them after the query file. In your example, I presume that DOMAIN is the parameter and is the parameter of your shell script. That gives :

#!/bin/sh
sqlplus esp @lisa $1
exit

And that's all (<<EOF is useless) !

In your query, the first parameter must be 'called' with &&1 (and the second with &&2, and so on).

Hope this helps.

Bye

-- 
 Pierre CHARPENAY
Received on Fri Apr 21 2000 - 00:00:00 CDT

Original text of this message

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