Re: Stored Procedure throwing TOO_MANY_ROWS at simultaneous access?

From: Reid Lai <reidlai_at_hk.super.net>
Date: 1996/06/16
Message-ID: <4pvmt3$bnb_at_tst.hk.super.net>#1/1


rharris_at_ties.org (Richard W. Harris) wrote:

>Hi,
 

>I have a very simple stored procedure that is part of an application.
 

>Given a part name, it looks up the part_id and returns it. Very simple
>query, and I've checked the parts table, and the rows are unique. Here's the
>problem:
 

>Once in a blue moon two people call the stored procedure at the exact same
>time looking up the same part number. When that happens, the stored procedure
>throws a TOO_MANY_ROWS exception. What?!
 

>To me, since it is just reading the table, this shouldn't happen. Is this a
>bug? It is some sort of busy/retry problem I can adjust?
 

>Any clues as to what is going on would be greatly appreciated.
 

>Thanks,
 

>--------------------------------
>Richard Harris
>rharris_at_ties.org
>http://www.city-net.com/~rharris

It seems you have used embedded SQL causing your problem in your procedure. Please add built-in exception or change this embedded SQL to cursor.

It is because whenever PL/SQL ecounters embedded SQL it will go to fetch twice using your SQL. The first time is really to fetch the result set and the second one will check if there is any additional rows returned from your SQL If so, TOO_MANY_ROWS will be raised. Received on Sun Jun 16 1996 - 00:00:00 CEST

Original text of this message