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: IF NOT EXISTS SELECT ...

Re: IF NOT EXISTS SELECT ...

From: g wayne nichols <gwn_at_cyber3.servtech.com>
Date: 1996/10/16
Message-ID: <543avc$sj6@cyber3.servtech.com>#1/1

In <DzC4Fn.E91_at_msi.com> swc_at_msi.com (Stephen W. Cook) writes:

>Try it like this :
> IF NOT EXISTS ( SELECT * FROM table WHERE col = value) THEN
 

>good luck!
>Stephen Cook

This produces the following PL/SQL compile error:

PLS-00204: function or pseudo-column 'EXISTS' may be used inside a SQL statement only

So you'll have to use a different approach (which others have already suggested).

>In article <53vsnr$7uf_at_newstoo.ericsson.se>, eraarm_at_hfera.ericsson.se wrote:
>>I would like to test the existence of rows as condition
>>in a PL/SQL if-clause:
>> IF NOT (EXISTS SELECT * FROM table WHERE col = value) THEN
>> ...
>> END IF;
>>
>>but Oracle complains about the syntax. I tried different variations
>>with/without parentheses without success.
>>Apparently, the EXISTS operator may only be used in subqueries.
>>Can you help?
>>

-- 
------------------------------------------------------------------------------
Computer General		Rochester, NY			(716) 436-6372
      "... providing general computer solutions to specific business problems"
                              gwn_at_servtech.com
Received on Wed Oct 16 1996 - 00:00:00 CDT

Original text of this message

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