Re: exception problem - Mailing list pgsql-novice

From Tom Lane
Subject Re: exception problem
Date
Msg-id 3391.1298396894@sss.pgh.pa.us
Whole thread Raw
In response to exception problem  (java4dev <java4dev@gmail.com>)
Responses Re: exception problem
List pgsql-novice
java4dev <java4dev@gmail.com> writes:
>     SELECT is_unlocked INTO v_is_unlocked
>     FROM aaa.domains
>     WHERE pk_domain_id = p_domain_id;

>     RETURN v_is_unlocked;

>     EXCEPTION
>     WHEN TOO_MANY_ROWS THEN
>         RETURN FALSE;
>     WHEN NO_DATA_FOUND THEN
>         RETURN FALSE;

Perhaps you want "if found then return v_is_unlocked; else return false;
end if;" in there.  Or if you really want to do it as above, you need to
say SELECT INTO STRICT to have those exceptions be thrown.  See the
manual.

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: simple test code
Next
From: Vibhor Kumar
Date:
Subject: Re: simple test code