Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with RETURNING clause
Message
 
 
À
27/09/2005 12:54:17
Information générale
Forum:
Oracle
Catégorie:
PL/SQL
Divers
Thread ID:
01053538
Message ID:
01053578
Vues:
15
I would change the PTable data type from char to varchar. Change ID from integer to number. I use "IS" instead of "AS" but that and the other 2 changes I suggested do not really matter. I just do not see any problem with your PL/SQL code. Can you trace what the actual value of PTabla is? What happens if you add...

SELECT count(*) INTO nKount FROM TBRHUIDS where Tabla = PTabla;

...before you try the update in your procedure code below? (add "nKount OUT NUMBER" to your list of procedure parameters before trying this and initialize nKount to zero in your code).

>CREATE OR REPLACE PROCEDURE NEWID
>(PTabla in Char,
>ID out Integer)
>AS
>begin
>Update TBRHUIDS
>Set LastID = LastID + 1
>Where Tabla = PTabla returning LastID into ID;
>commit;
>end;
>
>
>However, this gives a ORA-01422 error :exact fetch returns more than requested number of rows
>However, there is only ONE record matching the where clause.
>
>I know I could write a select statement after the update, but I need to guarentee that each concurrent access will get his own ID under heavy simultaneous accesses.
>Oracle 8.1.7
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform