我想将包含 XML 列的行复制到历史记录表。似乎不可能做到这一点?!
我试过的:
CREATE TRIGGER MARTIN."Pages_I" BEFORE UPDATE OF "tstamp" ON MARTIN."Pages" REFERENCING OLD AS old_row FOR EACH ROW MODE DB2SQL SECURED
INSERT INTO "MARTIN"."HistoryPages" VALUES (old_row."pageId", (SELECT "pageXML" FROM "MARTIN"."Pages" WHERE "pageId" = old_row."pageId" LIMIT 1), old_row."tstamp");
=> 由于 BEFORE 触发器中的 INSERT 而不允许
CREATE TRIGGER MARTIN."Pages_I" AFTER UPDATE OF "tstamp" ON MARTIN."Pages" REFERENCING OLD AS old_row FOR EACH ROW MODE DB2SQL SECURED
INSERT INTO "MARTIN"."HistoryPages" VALUES (old_row."pageId", old_row."pageXML", old_row."tstamp");
=> 不能引用 old_row."pageXML" 因为它是一个 xml 列
有没有解决这个困境的办法?