2 Replies Latest reply on Sep 11, 2013 3:37 PM by L-MachineGun

    How to capture Error Code in sqlplus


      I have a .sql file that is used as a wrapper file that when executes within sqlplus (, executes a bunch of .sql files within it. Example below:



      START D:\Scripts\A.sql "'04-01-2012 00:00:00'"

      START D:\Scripts\B.sql "'04-01-2012 00:00:00'"

      START D:\Scripts\C.sql "'04-01-2012 00:00:00'"

      START D:\Scripts\D.sql "'04-01-2012 00:00:00'"

      START D:\Scripts\E.sql "'04-01-2012 00:00:00'"



      Each of the .sql file (A,B,C,D,E)

      Spools individual output of sql statment within them. Each of the indv .sql file queries different tables with different filters(where) clause.


      I would like to capture any error (OS,SQL,DB) into the same indv spool file. The reason being is because later in the process we need to validate if there were any errors before processing and loading the data into our SQL database