Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: help with select into
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
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