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 > DB2 > How to Create a Trigger with Atomic option in DB2UDb in windows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-16-04, 04:59
bsaganand bsaganand is offline
Registered User
 
Join Date: Jan 2004
Location: Mumbai, India
Posts: 16
How to Create a Trigger with Atomic option in DB2UDb in windows

i have created 2 databases and created link between those 2 dbs using federated db.
now i want to create a trigger that, if i insert a row in client table which is in db2, then it should check the master table whichis in db1.
i tried to create trigger but it is not working.
i can select the rows using join from those tables residing in diff dbs.
pls help me out how to create a trigger fo r this Db2Udb in windows
Sakthi
__________________
G.Sakthi
Reply With Quote
  #2 (permalink)  
Old 01-16-04, 08:47
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Did you create a wrapper for the master table in database db2? If so what name did you give it? Could you also post the trigger definition that you are trying to create?

Andy
Reply With Quote
  #3 (permalink)  
Old 01-19-04, 04:12
bsaganand bsaganand is offline
Registered User
 
Join Date: Jan 2004
Location: Mumbai, India
Posts: 16
Thumbs up

Quote:
Originally posted by ARWinner
Did you create a wrapper for the master table in database db2? If so what name did you give it? Could you also post the trigger definition that you are trying to create?

Andy
Hi

its worked now,
this is the trigger i created

CREATE TRIGGER Test1 no cascade before insert ON emp1 REFERENCING NEW AS N FOR EACH ROW MODE DB2SQL WHEN (deptno NOT IN (SELECT deptno FROM dept)) SIGNAL SQLSTATE '75000' ('Referencial integrity Error before insert')

thanx a lot again
__________________
G.Sakthi
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