![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 18 Sep 2003 @ 14:27:25 GMT
Narayan Thanks for the thoughts, unfortunately it looks like there are internal constraints that prohibit this approach. **** 09:37:59 UTY1008 RDBMS failure: 5529, A triggered statement inside a row trigger can not refer to a table that is being changed by the row trigger. I tried creating a before & after trigger and neither seemed to work. This was the def
CREATE TABLE SEQ (TABLENAME CHAR(30), NEXTREC INTEGER NOT NULL DEFAULT 0)
UNIQUE PRIMARY INDEX (TABLENAME);
INSERT INTO SEQ VALUES('TPTB1',1);
REPLACE TRIGGER NEXTREC ENABLED AFTER INSERT ON TPTB1
FOR EACH ROW (
UPDATE SEQ SET NEXTREC = NEXTREC + 1 WHERE TABLENAME='TPTB1';
) ;
INSERT INTO tptb1 ( a1,a2,a3,a4 )
SELECT :cc1 ,:cc2 (Date, Format 'YYYY/MM/DD') ,:cc3, NEXTREC FROM SEQ
WHERE TABLENAME='TBTB1' ;
Thanks for the help. Any more ideas? Doug Little
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||