| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Two questions in Oracle...
You may add a check for NULL because the comparison would always fail if one of :new.fielda, :old.fielda is null. If both were null it depends if you reckon that as an update or not.
Martin
david.archer_at_chase.com wrote:
> 
> I see your first part has been answered.  Let me have a stab at question
> 2.
> 
> Try the following:
> 
> IF Updating THEN
>   IF :NEW.fieldA <> :OLD.fieldA THEN
>     PRO1;
>   END IF;
>     PRO_ALL;
> ELSIF Inserting THEN
>   ...
> ELSIF Deleting THEN
>   ...
> END IF;
> 
> Good Luck,
> 
> David Archer
> 
> In article <37C60A34.BA2A611B_at_comp.polyu.edu.hk>,
>   Jimmy <c6635500_at_comp.polyu.edu.hk> wrote:
> > Hello all,
> >     I have two questions: (in Oracle 7.3.3)
> >
> > 1) Why the following SQL statement returns 'aaa'?
> >
> >     select 'aaa' from dual where 'LOW_D_LIMIT' like 'L_%';
> >
> >     Is '_' means special character? 'LOW_D_LIMIT' not contains the
> > string like 'L_' and it should return 'no rows returned' I
> > think......... but it returns 'aaa'....
> >
> > 2) I want to develop a trigger like this:
> >
> > create or replace trigger testing
> > after update or insert or delete on aaa
> > begin
> >    if updating then
> >       if updating(fieldA) then
> >          pro1;
> >       end if;
> >       pro_all;
> >    elsif inserting then
> >       ...
> >    elsif deleting then
> >       ...
> >    end if;
> > end;
> > /
> >
> >     If update column fieldA, then do pro1 and pro_all Other columns
> > updating do only pro_all.
> >     However, errors in creating this trigger.... Is it possible to
> check
> > which column is updated in the updating part? I cannot do this:
> >
> > create or replace trigger testing
> > after update(fieldA) or insert or delete on aaa
> > ...
> >
> >     since this trigger only fired if fieldA is updated.
> >
> > Thanks,
> > Jimmy
> >
> >
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Sat Sep 04 1999 - 03:29:16 CDT
![]()  | 
![]()  |