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 -> Seeing new transaction data while a trigger is firing

Seeing new transaction data while a trigger is firing

From: <mtayag_at_my-dejanews.com>
Date: Thu, 02 Jul 1998 17:20:30 GMT
Message-ID: <6ngfgt$96t$1@nnrp1.dejanews.com>


Consider the following table

TEMP_TABLE

COL_1        COL_2
======       ======
X            1
X            2
X            3

Now consider the following transaction:
<START TRANSACTION>

   insert into TEMP_TABLE (COL_1, COL_2) VALUES (Y, 2);
   insert into TEMP_TABLE (COL_1, COL_2) VALUES (Y, 4);
   insert into TEMP_TABLE (COL_1, COL_2) VALUES (Y, 6);
   insert into TEMP_TABLE_2 (COL_1) VALUES ('DONE');
   commit;
<END TRANSACTION>

An application (independent of the trigger) is performing the transaction into TEMP_TABLE.
I have a trigger on TEMP_TABLE_2 that is defined as the following:

CREATE OR REPLACE TRIGGER trgTEMP_TABLE_2 after insert on TEMP_TABLE_2 for each row DECLARE
    SumOfCOL_2 number;
BEGIN
    select sum(COL_2) into SumOfCOL_2 from TEMP_TABLE where COL_1 = 'Y'; END; The problem is that the trigger does not recognize any of the values being inserted as part of the transaction, even though it is an "after insert" trigger.

Note: I am using Oracle 7.3.

Anyone have any ideas as to how I can get the trigger to see these values? If you have an idea, please respond by e-mail to mtayag_at_obviousmrp.com Thanks in advance for your help.

Michael Tayag

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Jul 02 1998 - 12:20:30 CDT

Original text of this message

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