2 Replies Latest reply: Sep 11, 2013 10:37 AM by L-MachineGun RSS

    How to capture Error Code in sqlplus

    e9fa0136-057b-4007-90bc-4cfb2a697be0

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

       

      WRAPPER.SQL

      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'"

      EXIT;

       

      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