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
SET NROW.UPDATE_TS = CURRENT TIMESTAMP;
SET NROW.CREATE_TS = CURRENT TIMESTAMP;
SET NROW.UPDATE_USER = USER;
SET NROW.CREATE_USER = USER;
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.