I am creating a trigger that when a new row is inserted into table CMPCHKINS another table CMPCKINHEARINGS is updated with the time the officer checked in. In reviewing the Redbook on Triggers and Stored Procedures, it appears that all I need to do in the SQL statements of the trigger is:
Is that right?
Leslie
Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
Code:
/* Creating SQL trigger CMLIB.INSERT_TO_CHECKINHEARINGS */
CREATE TRIGGER CMLIB.INSERT_TO_CHECKINHEARINGS
AFTER INSERT ON CMLIB.CMPCHKINS FOR EACH ROW
MODE DB2ROW
BEGIN ATOMIC
UPDATE CMPCKINHEARINGS SET ChkInTIme = ChkInTIme WHERE CasPre=CasPre AND CasNum=CasNum AND CRTROM = CRTROM
END;
Is that right?
Leslie
Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins