Re: error handling using stored procedure

From: Mladen Gogala <mladen_at_bogus.email.com>
Date: Tue, 21 Apr 2009 20:21:12 +0000 (UTC)
Message-ID: <gsl9ro$d7h$1_at_solani.org>



On Tue, 21 Apr 2009 10:38:16 -0700, Jorge Reyes wrote:

> Hello everyone,
>
> Question: Is it possible to catch the error of duplicate key using an
> "insert into table select ...." inside of an stored procedure?

Yes.

>
> Target: Execute my stored procedure each 15 minutes and insert all the
> non-duplicate records from a source table, and if its possible, the
> values of the duplicate records SUM with the existing values.

MERGE statement would be faster than a stored procedure for that purpose.

>
> 12:29:41.081 DBMS nmsnoc-db -- Error: PLS-00103: Encountered the
symbol
> "EXCEPTION" when expecting one of the following: 12:29:41.143 DBMS
> nmsnoc-db -- begin case declare end exit for goto if loop mod null

You have a syntax error, that's all.

-- 
http://mgogala.freehostia.com
Received on Tue Apr 21 2009 - 15:21:12 CDT

Original text of this message