For a simple table that looks like this:
CREATE TABLE &LIB/ACMSTABLE (
KEY_NBR FOR COLUMN TSTNBR NUMERIC(9, 0) NOT NULL DEFAULT 0 ,
UPDATE_TS FOR COLUMN UPDATETS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
CREATE_TS FOR COLUMN CREATETS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
UPDATE_USER FOR COLUMN UPDATEUSER CHAR(18) NOT NULL DEFAULT USER,
CREATE_USER FOR COLUMN CREATEUSER CHAR(18) NOT NULL DEFAULT USER,
PRIMARY KEY( KEY_NBR, TEST_CHAR ) ) ;
Here is a simple BEFORE-INSERT trigger definition:
CREATE TRIGGER &LIB/ACMSTABLE_BEF_INS
BEFORE INSERT on ACMSTABLE
REFERENCING NEW as NROW
FOR EACH ROW
MODE DB2ROW
BEGIN
SET NROW.UPDATE_TS = CURRENT TIMESTAMP;
SET NROW.CREATE_TS = CURRENT TIMESTAMP;
SET NROW.UPDATE_USER = USER;
SET NROW.CREATE_USER = USER;
END
Compile the table, then compile the trigger. I can't help with the promotion, that is handled by another team here due to Sarbanes-Oxley 8^( .
There were problem in early releases of Aldon that were due to bugs in ACMS. They quickly fixed those once they were identified. What version are you on? We are aon 7.5A. I think it was 7.3 that first handled SQL objects. 7.4 provided the fixes.
Last Wiki Answer Submitted: March 8, 2010 2:55 pm by NullFields880 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
I’m not sure how to do this with ALDON but you should be able to add your trigger with the ADDPFTRG command. I imagine that is what ALDON is doing under the covers.
I would expect that Aldon allows you to create something like custom “types” for promotion. Create a type like “PFTRG” that runs commands to replace triggers when you promote it. Promote the PFTRG object together with your trigger program.
I’m almost certain that that’s not enough to tell you what to do, but it might spark some thoughts from someone else who has Aldon available. If you can wait a couple days, I might be able to investigate Aldon to see how it works.
hi . I have a PF(ex : ABC) already in production. I need to add a trigger program(ABCD) to that file through ALDON and should promote to production.
Please tell me how to perform this??
I’m not sure how to do this with ALDON but you should be able to add your trigger with the ADDPFTRG command. I imagine that is what ALDON is doing under the covers.
I would expect that Aldon allows you to create something like custom “types” for promotion. Create a type like “PFTRG” that runs commands to replace triggers when you promote it. Promote the PFTRG object together with your trigger program.
I’m almost certain that that’s not enough to tell you what to do, but it might spark some thoughts from someone else who has Aldon available. If you can wait a couple days, I might be able to investigate Aldon to see how it works.
Tom