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

Home -> Community -> Usenet -> c.d.o.misc -> Re: help!!!

Re: help!!!

From: Dante <dnotari_at_my-deja.com>
Date: Thu, 03 Jun 1999 09:32:03 GMT
Message-ID: <7j5i2k$bdp$1@nnrp1.deja.com>


Simon,
  I see two possibilities for you.

  1. you use an exception handler: BEGIN -- to mark the scope of the exception handler SELECT .... EXCEPTION WHEN NO_DATA_FOUND THEN NULL; -- or anything else END;
  2. you use MAX or MIN SELECT MAX(your value) INTO :dummy ....
     then you can check :dummy IS NULL if
     something was found or not. Note that with
     this approach you won't know if you get more
     than one value.

Regards
Dante

In article <37555C22.E5E1DDBF_at_cs.auc.dk>,   Chen Li <erpeng_at_cs.auc.dk> wrote:
> Hi, All:
>
> I am writing a before insert trigger. I want to make a comparison
> between the new record and
> others which are already in the database. For example: the name of my
> table is myt, when I
>
> select *** from myt
> into *** where a = :new.a and b=:new.b;
>
> It is obviously that there is no data in the database at first, so no
> data can be selected and even
> when there is data in the database, sometimes no data fulfill the
select
> criteria so no data is selected, the result is the trigger does not
> work. How to handle such situation? Thanks.
>
> Simon
>
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Jun 03 1999 - 04:32:03 CDT

Original text of this message

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