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: simple trigger problem

Re: simple trigger problem

From: Nitin Dahiya <ndahiya_at_hotmail.com>
Date: Fri, 23 Jul 1999 20:20:15 +0200
Message-ID: <7nc6r1$abj$1@pumba.class.udg.mx>


you might like to commit the insert.

regards,
nitin.

<yliu_at_creighton.edu> wrote in message
news:Pine.HPP.3.95.990722162533.24591A-100000_at_penguin.creighton.edu...
> Hi,
>
> I was wondering if somebody please help me with the following creating
> trigger problem: I have a table called yongge (name varchar2(50), age
> number(3)). I want to validate the age field when I insert/update on the
> table. Therefore, I created a trigger as follows:
>
> create or replace trigger check_age
> before insert or update on yongge
> for each row
> declare
> low_age constant number :=0;
> hi_age constant number :=200;
> begin
> if (:new.age > hi_age or :new.age < low_age) then
> insert into error_log values(sysdate, 'Age out of range');
> raise_application_error(-20500, 'Age out of range');
> end if;
> end;
> /
>
> The above trigger was created without error. However, every time when I
> try to insert a age value which is out of range, I could not find my
> corresponding entry in my error_log table.
>
> Any help would be appreciated.
>
> Best regards,
> yliu_at_creighton.edu
>
Received on Fri Jul 23 1999 - 13:20:15 CDT

Original text of this message

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