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

Home -> Community -> Usenet -> c.d.o.server -> Re: Bogus table for "instead of" trigger

Re: Bogus table for "instead of" trigger

From: Morten <morten_at_kikobu.com>
Date: Thu, 07 Feb 2002 22:02:07 +0100
Message-ID: <3C62EB4F.5090206@kikobu.com>


damorgan wrote:

> I can not make sense of your question. If you want to put a trigger on
> the table put a trigger on the table. It just won't be an "instead of"
> trigger.

This may be a very special case, but the example below shows what I wanted to accomplish, I just got puzzled when I made it:

CREATE TABLE ranged_table
(low NUMBER, high NUMBER, group_id VARCHAR2(128), user_sid VARCHAR2(128));

CREATE VIEW ranged AS
SELECT * FROM ranged_table;

CREATE OR REPLACE TRIGGER range_trigger
INSTEAD OF INSERT ON ranged
FOR EACH ROW
DECLARE
   articleID NUMBER;
BEGIN
   FOR i IN :new.low .. :new.high LOOP

     INSERT INTO group_mapper
     VALUES (i, :new.group_id, :new.user_sid);
   END LOOP;
END;
/

If I insert a lot of records, I'm not interested in anything by an "instead of" trigger. But the explanations so far satisfy my curiosity. Sort of ;)

Morten Received on Thu Feb 07 2002 - 15:02:07 CST

Original text of this message

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