Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to execute PL SQL script with parameters from shell script?

User_TDDEPSep 9 2015 — edited Sep 10 2015

I try to execute follow bash script:

#!/bin/bash

output=`sqlplus -s "sqlplus test/test@rac1.localdomain:1521/GDBN @test.sql 'var1' 'var2' " <<EOF

           set heading off feedback off verify off

           exit

EOF

`

echo $output

if [[ $output =~ ERROR ]]; then

     echo "ERROR"

else

     echo "OK"

fi

it do not work for me.

I don't know how to format this 2 string parameters var1 and var2 inside on bash script.

How can I pass this parameters in this case?

Have someone any experience how to do this?

Regards

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2015
Added on Sep 9 2015
13 comments
4,345 views