Here is a ksh :
$ORACLE_HOME/bin/sqlplus id/psw@$ORACLE_SID @$P_SQL/mysql.sql $1
return_code=$?
echo return_code
Here is the sql :
set serverout on
var error number
...
declare
error number(1) := 0;
begin
.......
exception
when too_many_rows then
error := 2;
end;
/
exit
How to pass the PLSQL error value to SQLPLUS variable and then the SqlPlus variable to the ksh variable return_code.
Thank you