Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can i write the trigger for Global Temporary Table

791525Dec 28 2010 — edited Dec 29 2010
Hi Grus,
How can i write the trigger for Global Temporary Table.

I was created the GTT with trigger using the below script .


CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
(
EMP_C_NAME VARCHAR2(20 BYTE)
)
ON COMMIT PRESERVE ROWS;


CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
BEFORE DELETE OR UPDATE OR INSERT
ON GLOBAL_TEMP
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
END;
/


trigger was create successfully, but the wouldn't insert into to EMPNAME Table..

Please guide whether am correct or not? if not kindly give a correct syntax with example


Thanks in Advance,
Arun M M
This post has been answered by V prasad on Dec 28 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 26 2011
Added on Dec 28 2010
3 comments
1,338 views