hi everybody,
Can anyone tell me how can I make a trigger which triggers when a clob is updated???
Thanks
edli
Printable View
hi everybody,
Can anyone tell me how can I make a trigger which triggers when a clob is updated???
Thanks
edli
I don't think it should be any different from any other column with any other datatype.
Documentation says ...
Quote:
You can reference object columns or their attributes, or varray, nested table, or LOB columns.
I have this trigger:
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.
Please help
Edli
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.
like this for example:
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.
What else can I do?
what version are you on?
Version 8.1.7
http://download-west.oracle.com/docs...4mn9.htm#98328
check :old.content
I haven't been able to resolve this thing yet.
If anyone has ever done this before please tell me how can I come around it.
Thank you.