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 -> Use of Exists in an If statement-URGENT!!!

Use of Exists in an If statement-URGENT!!!

From: anurag <aminochaNOamSPAM_at_unibiz.com.invalid>
Date: 2000/06/21
Message-ID: <09dd2ecc.13f8e8d8@usw-ex0105-034.remarq.com>#1/1

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 bind
variable> 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

Original text of this message

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