I am using open/print to execute a SQL statement using sqlplus, like this:
open (PLSQL, "|sqlplus -s $db_url");
print PLSQL <<ENDSQL;
... some SQL statements ...
exit;
ENDSQL
close(PLSQL);
My question is how to capture the exit code of executing the sql statement if it runs into some errors. I think using DBI should be much better, but I prefer to have a solution to the problem above. Thanks a lot!