Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem with running saqlplus in shell script
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 CHARPENAYReceived on Fri Apr 21 2000 - 00:00:00 CDT
![]() |
![]() |