Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: exception handling with explicit cursors?
for explicit cursors use
fetch <cursor> into ....
if <cursor>%notfound then
Hth,
Sybrand Bakker, Oracle DBA
"Jules" <newsreply@[dontspamme]szemtech.com> wrote in message
news:8oci48$j05$1_at_towncrier.cc.monash.edu.au...
> Can it be done?
>
> ie, this works:
> DECLARE
> ItemDESC item.itemdesc%TYPE;
> CurrItemID BINARY_INTEGER;
> BEGIN
> CurrItemID := 890;
> SELECT item.itemdesc
> INTO ItemDESC
> FROM item
> WHERE item.itemid = 890;
> DBMS_OUTPUT.PUT_LINE('Item ID: ' || TO_CHAR(CurrItemID) || '
Item
> Description: ' || ItemDESC);
> EXCEPTION
> WHEN NO_DATA_FOUND THEN
> DBMS_OUTPUT.PUT_LINE('No data was found');
> END;
> /
>
> -- which handles the NO_DATA_FOUND case for an implicit cursor...
> but when an explicit cursor is used... no error is triggered when no rows
> are returned...
>
> can anyone help?
>
> Jules
>
>
>
>
Received on Sun Aug 27 2000 - 23:58:12 CDT