Re: Which rows cause exception

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 20 Nov 2008 12:33:47 -0800
Message-ID: <1227213204.77631@bubbleator.drizzle.com>


Terry Dykstra wrote:
> Oracle 9.2.05 SE
>
> In a stored procedure I have code like this:
>
> INSERT INTO DPRS_WELL (PRODUCTION_MONTH,UWI,....)
> SELECT ad_prod_date,UWI,...
> FROM DPRS_WELL_LOAD
> WHERE PRODUCTION_MONTH = add_months(ad_prod_date,-1);
>
>
> EXCEPTION
> WHEN DUP_VAL_ON_INDEX THEN
> RAISE_APPLICATION_ERROR(-20001,'Duplicate UWI', true);
> WHEN VALUE_ERROR THEN
> RAISE_APPLICATION_ERROR(-20002,'Value error', true);
>
>
> Is there any way I can determine in the exception block which row(s) caused
> the exception?

http://www.psoug.org/reference/dbms_errlog.html

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Nov 20 2008 - 14:33:47 CST

Original text of this message