If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
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, 03: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, 22: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

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