I am trying to write a generic script as a part of a framework which will establish Oracle DB connection once and loops in to check for some files which gives the SQL statements to execute.
The script is running but I am stuck with capturing errors ( ORA and SP) and outputs. Example:
${ORACLE_HOME}/bin/sqlplus -s ${loginid}/${password}@//${server}:${port}/${servicename} |&
while [[ $flag -eq 1 ]]
do
#obtain the $sql_stmt from a file here
print -p -- "${sql_stmt}"
# if it is select statement i use read -p to obtain the output
done
print -p -- exit