Re: error handling using stored procedure

From: Jorge Reyes <jorg_reyes_at_hotmail.com>
Date: Tue, 21 Apr 2009 13:46:12 -0700 (PDT)
Message-ID: <ab7d95e7-2ec7-4e02-a558-0d6b14590a20_at_f20g2000vbf.googlegroups.com>



On 21 abr, 15:21, Mladen Gogala <mla..._at_bogus.email.com> wrote:
> 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
  1. So there are no problem with using EXCEPTION inside of an Store Procedure?
  2. What's about the second option? is it possible to implement inside of an Store Proc?

Thanks in advanced Received on Tue Apr 21 2009 - 15:46:12 CDT

Original text of this message