My query basically is when I am trying to run multiple oracle scripts from bash how do I put comments in between the scripts. I have tried using a workaround by selecting a string from dual. But the output formatting isn't very good.
Can anyone please suggest me a better way.
My Code
#!/bin/bash
#Run Script
echo "-------------------------------"
echo "***Running Script1***"
echo "-------------------------------"
sqlplus -S UID/PSW@DB << EOF
whenever sqlerror exit sql.sqlcode;
set echo off
set heading off
@/my/path/Script1
Select '--------------' from dual;
select '***Running Script1***' from dual;
Select '--------------' from dual;
@/my/path/Script2
exit;
EOF
Output
-------------------------------
***Running Script1***
-------------------------------
SP2-0310: unable to open file "my/path/Script1.sql"
--------------
***Running Script2***
--------------
SP2-0310: unable to open file "my/path/Script2.sql"
Expected Output
-------------------------------
***Running Script1***
-------------------------------
SP2-0310: unable to open file "my/path/Script1.sql"
--------------
***Running Script2***
--------------
SP2-0310: unable to open file "my/path/Script2.sql"