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: Can I have an instead of update and insert triggers on the same view?

Re: Can I have an instead of update and insert triggers on the same view?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 18 Mar 2001 10:45:34 -0000
Message-ID: <984912144.7661.0.nnrp-12.9e984b29@news.demon.co.uk>

Just done a quick check in 8.1.7
the following works:

create or replace trigger v_iu
instead of insert or update on v1
begin
  if inserting then

      null;
  elsif updating then

        null;
    end if;
end;
/

> We've made good use of instead of triggers to do simple tasks. What
> don't you like about them?

I didn't say I didn't like them, I just said it was generally hard to code them correctly - which was a bit of a generalisation. More like 'if they are at all complicated, they tend to be very complicated'.

--
Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Practical Oracle 8i:  Building Efficient Databases
Publishers:  Addison-Wesley

Reviews at: http://www.jlcomp.demon.co.uk/book_rev.html



Van Messner wrote in message ...

>Hi Jonathan:
>
> Two questions:
> I don't have Oracle here today but can you use conditional predicates
in
>"instead of triggers" i.e. when inserting, when updating and so on? Then
>the poster would need only one trigger per view.
> We've made good use of instead of triggers to do simple tasks. What
>don't you like about them?
>
>Van
>
>
>
Received on Sun Mar 18 2001 - 04:45:34 CST

Original text of this message

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