Running multiple sql files in unix

In c:/zaheer/123-456/sql/ folder i have below 7 sql files.

cv_abc_a.sql
cv_abc_b.sql
cv_abc_c.sql
vtemp_d.sql
vtemp_e.sql
cv_abc_f.sql
Exviews.sql

In Exviews.sql file i have mentioned all cv and vtemp files to run like

start ${SQLDIR}/cv_abc_a.sql
start ${SQLDIR}/cv_abc_b.sql
start ${SQLDIR}/cv_abc_c.sql
start ${SQLDIR}/vtemp_d.sql
start ${SQLDIR}/vtemp_e.sql
start ${SQLDIR}/cv_abc_f.sql

My aim is to run all sql files in order which present in Exview.sql file
even if error occured print that error and continue with next file.

Please suggest.
Thanks in advance

So just execute the script "Exview.sql".
You have put down the order already. So all you need is to execute it.
(Unless I am missing something.)

If we are talking about Oracle, then I think this really depends on the way exceptions are handled in those individual sql files.

  • If you have no EXCEPTION block in any sql file, then the error message will be escalated to the client program (which I assume is sqlplus in this case.)
  • If you have handled exceptions in those sql files, then the error will be printed only if you programmed it so.
  • If you have those ghastly "when others then null;" or "when <XYZ> then null;" exception handlers then your script essentially gobbles up the exception.

In all cases, sqlplus will continue with the next file, unless you have run the command "whenever [sqlerror|oserror] then exit ..." somewhere in the sqlplus session.

tyler_durden