Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: help with select into

Re: help with select into

From: Sandy Thrasher <sandra.thrasher_at_MCI2000.com>
Date: 1998/01/15
Message-ID: <%Jlv.2148$An2.666903@news.internetMCI.com>#1/1

Here's a way to make sure the following SELECT in your example does not abort if no rows are found....

>Select match_prod_id
>into new_prod_id_out
>from product_up_cross_sell
>where product_up-cross_sell.base_prod_id = prod_id_in
>and product_up_cross_sell.match_type = 'U'
>

IF SQL%NOTFOUND THEN

There is also SQL%FOUND or you could define an exception like below:

BEGIN
>Select match_prod_id
>into new_prod_id_out
>from product_up_cross_sell
>where product_up-cross_sell.base_prod_id = prod_id_in
>and product_up_cross_sell.match_type = 'U'
>

EXCEPTION
   WHEN NO_DATA_FOUND THEN

Sandy Received on Thu Jan 15 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US