Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Use of Exists in an If statement-URGENT!!!
Hi,
I am trying to use the following syntax in a stored procedure to
see whether a particular value exists in a table. But it gives
me an error. This I am doing so that it does not throw a
no_data_found exception which I have to explicitly handle.
The piece of code which is giving me error is
if duration >= 7 and duration < 28 then
if (select 'x' from InvRentalprice where EXISTS (select #
from InvRentalPrice where unit = 0)) then
unit := 0;
else
and the error is
LINE/COL ERROR
-------- -------------------------------------------------------- 29/9 PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + mod not null others <an identifier> <a double-quoted delimited-identifier> <a bindvariable> avg count current exists max min prior sql stddev sum variance cast <a string literal with character set specification> <a number> <a single-quoted SQL string>
29/118 PLS-00103: Encountered the symbol "THEN" when expecting one of the following: ) intersect minus union
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
Received on Wed Jun 21 2000 - 00:00:00 CDT