Re: Which rows cause exception

From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Mon, 24 Nov 2008 11:45:38 +0000 (UTC)
Message-ID: <gge452$cvt$2@solani.org>


On Thu, 20 Nov 2008 15:58:43 +0000, 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?

Hmmm, in version 10g you could use dbms_errlog package.

-- 
Mladen Gogala
http://mgogala.freehostia.com
Received on Mon Nov 24 2008 - 05:45:38 CST

Original text of this message