PLSQL exception handling

From: Schauss, Peter (ESS) <"Schauss,>
Date: Thu, 9 Jun 2011 19:12:35 +0000
Message-ID: <>

Oracle (Linux x86-64).

I am writing stored procedure which copies information from one table to another, doing some transformations in the process. I am using the %rowtype construct for the fetches and inserts and doing a large number of assignment statements in the form:

rec1.col1 := rec2.cola;

Since there is a possibility of type conversion errors in some cases, I need to be able to trap errors and identify the offending column in the input table. The Oracle documentation suggests something like this:

step_num:= <n>
rec1.col1 := rec2.cola;
rec1.col2 :=rec2.colb;


	when <error type> dbms_output.put_line('error at '||step_num);


Is there a better way for me to identify the location of the error?

Peter Schauss

Received on Thu Jun 09 2011 - 14:12:35 CDT

Original text of this message