Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Into variable...what is return value
Message
Information générale
Forum:
Oracle
Catégorie:
PL/SQL
Divers
Thread ID:
00408972
Message ID:
00409122
Vues:
26
The answer is one of three conditions...

a) It is a NULL value....If there is a matching row and the value is empty
or
b) You get an exception NO_DATA_FOUND returned... If there is no matching rows...
or
c)you get an excepotion TOO_MANY_ROWS in this case more than 1 row match the where clause..


However, if no rows are returned, PL/SQL raises


CREATE OR REPLACE PROCEDURE FOO
AS
BEGIN
SELECT Password INTO TablePword
FROM UserControl
WHERE UserID = LoginID;
EXCEPTIONS
WHEN TOO_MANY_ROWS THEN
/*do something or null to alow prgram to exit normally*/
NULL;

WHEN NO_DATA_FOUND THEN
/*no match: do something or null to allow prgram to exit normally*/
NULL;

END FOO;

The sql syntax my not be exactly correct!?!?

Hope that helps....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform