Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger problem with federated database

Status
Not open for further replies.

grofaty

IS-IT--Management
Jan 16, 2003
370
SI
I have a federated system in Windows 2000 (DB2 EE 7.2 fixpack 5) and remote system in Windows 2000 (DB2 EE 7.2 fixpack 5).

I would like to create trigger witch will check referencial integrity with the table in federated system witch points to table in remote system - somehow simulate an foreign key witch can not be defained between federated system and remote database.

I created two test tables. Customer is inside federated system, State is inside remote database.

Custumer (customerID integer, stateID integer)
State (stateID integer, stateDes char(20))

I tried to write trigger to simulate foreign key for update on Custumer table:

CREATE TRIGGER REF_INTEGRITY AFTER UPDATE OF stateID ON Custumer REFERENCING NEW AS N FOR EACH ROW MODE DB2SQL WHEN (N.StateID NOT IN (SELECT StateID FROM State)) SIGNAL SQLSTATE '75000' ('Referencial integrity Error after update')

This command returns the error:

SQL0901N The SQL statement failed because of a non-severe system error. Subsequent SQL statements can be processed. (Reason "".) SQLSTATE=58004

Is this a sign that I can not make a call to remote table from trigger?

Grofaty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top