Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Informix > SQL Trigger using Informix database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-26-07, 04:25
who_does who_does is offline
Registered User
 
Join Date: Dec 2007
Posts: 2
Question SQL Trigger using Informix database

I still new in SQL Trigger using Informix database. I really need help from the expert to solve my problem.

How can I TRIGGER tempTable on new record inserted then insert the new record into actualTable? After that I want to TRIGGER actualTable on new record inserted and delete the same record on tempTable?

Here is my SQL TRIGGER:

CREATE TRIGGER t1
INSERT ON tempTable
REFERENCING NEW AS original
FOR EACH ROW WHEN (original.status = 'Y')
(INSERT INTO actualTable
(field1,field2,field3,status)VALUES(original.field 1,original.field2,original.field3,original.status) );


CREATE TRIGGER t2
INSERT ON actualTable
REFERENCING NEW AS original
FOR EACH ROW WHEN (original.status = 'Y')
(DELETE tempTable WHERE field1=original.field1);

Here is error found:

Error: Table or column matches object referenced in triggering statement. (State1000, Native Code: FFFFFD15)
Reply With Quote
  #2 (permalink)  
Old 12-29-07, 23:19
who_does who_does is offline
Registered User
 
Join Date: Dec 2007
Posts: 2
Smile Some helpful explanation by Tony

If anyone facing the same problem as mine, please visit techrepublic for some helpful explanation by Tony...

http://techrepublic.com.com/5208-623...248859&start=0
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On