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: Van Messner <vmessner_at_bestweb.net>
Date: Sat, 17 Mar 2001 22:22:03 GMT
Message-ID: <fsRs6.198$Te.45567@monger.newsread.com>

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

"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message news:984820954.807.0.nnrp-12.9e984b29_at_news.demon.co.uk...
>
> create or replace trigger view_insert
> instead of
> insert
> on my_view
> begin
> null;
> -- some other code
> end;
> /
>
> then replace insert with update / delete.
>
> If this doesn't work, it is possible that
> your version / level of Oracle doesn't
> support INSTEAD OF triggers.
>
> NB It is usually very difficult to
> code such triggers correctly.
>
>
> --
> 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
>
>
>
> don wrote in message <0u15btco7vpgt10k9nsea67c8bpl6isj53_at_4ax.com>...
> >I have a view which I need to insert into, update, and delete from.
> >How can I create instead of triggers for each of these actions?
> >
> >Thanks,
> > Don
>
>
Received on Sat Mar 17 2001 - 16:22:03 CST

Original text of this message

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