CREATE OR REPLACE TRIGGER TBLWCONT_AI_ROW AFTER
INSERT OR
UPDATE OF CONTENT, IDDOCUMENT,IDUSERWHOCREATE,
IDWORKINGCONTENT
ON TBLWORKINGCONTENT
FOR EACH ROW begin
if inserting then
INSERT INTO tblworkingcontentversion (idworkingcontentversion,content,IdWorkingContent,IdUser,MinorVersion, idDocument) values
(sq_tblwcontvers.nextval,:new.content,:new.idworkingcontent,:new.iduserwhocreate,1,:new.iddocument);
end if;
if UPDATING then
INSERT INTO tblworkingcontentversion (idworkingcontentversion,Content,IdWorkingContent,IdUser, idDocument) values
(sq_tblwcontvers.nextval,:new.content,:new.idworkingcontent,:new.iduserwhocreate,:new.iddocument);
end if;
end;
content is a clob type.
And I had the following error:
ORA-25006: cannot specify this column in UPDATE OF clause
Cause: Attempt to create a trigger on update of a column whose datatype is disallowed in the clause, such as LOB and nested table.
I don't know how to do this because that's just what I want to do.
A trigger that trggers on the update of the clob datattype.
Get rid of 'OF ' part. Trigger will fire on all updates on table and you will have to perform some manual comparison in trigger code to find out which columns changed.
Tomaž "A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams
CREATE OR REPLACE TRIGGER TBLWCONT_AI_ROW AFTER
INSERT OR
UPDATE
ON TBLWORKINGCONTENT
FOR EACH ROW begin
if inserting then
INSERT INTO tblworkingcontentversion (idworkingcontentversion,content,IdWorkingContent,IdUser,MinorVersion, idDocument) values
(sq_tblwcontvers.nextval,:new.content,:new.idworkingcontent,:new.iduserwhocreate,1,:new.iddocument);
end if;
if UPDATING then
if :new.content<>old.content then
INSERT INTO tblworkingcontentversion (idworkingcontentversion,Content,IdWorkingContent,IdUser, idDocument) values
(sq_tblwcontvers.nextval,:new.content,:new.idworkingcontent,:new.iduserwhocreate,:new.iddocument);
end if;
end if;
end;
it gives me the same error as before can not specify this column in
update clause.
Tomaž "A common mistake that people make when trying to design something completely
foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams
Bookmarks