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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Question on Proper Use of EXISTS

Re: Question on Proper Use of EXISTS

From: Norbert <usun_to.norbert_at_exbud.com.pl>
Date: Fri, 30 Mar 2001 10:48:11 +0200
Message-ID: <9a1h33$n3s$1@news.tpi.pl>

AFAIK only functions can return data so You must write a database function or use sth like this:
declare
  dummy number(1);
begin
  Select 1 into dummy
    from Mytable where Mytable.ID = :OLD.ID;   raise too_many_rows;
exception
  when no_data_found then

greets

Norbert

>Uzytkownik "Ray Vonhollen" <RVONHOLLEN_at_pacbell.net> napisal w wiadomosci
>news:3AC41D27.E5F26304_at_pacbell.net...
>I'm getting contrary information between earlier Oracle documentation on
the proper use of the EXISTS >condition and current useage in Oracle 8i. What I'm simply
>trying to accomplish is to see if a record(s) exists within a Delete After
Trigger, and then perform some >action if it does. The target table may contain many instances, but I just need to return a True or False if >it EXISTS at all.
>(Example, Sybase or SQL)
>If EXISTS (Select 1 from Mytable where Mytable.ID = :OLD.ID) Then
>..
>..
>END IF;
> ......
Received on Fri Mar 30 2001 - 02:48:11 CST

Original text of this message

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