trigger+lob+ora-22275
CREATE OR REPLACE TRIGGER test
BEFORE DELETE OR UPDATE
ON table_A
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
as
l_blob blob;
begin
if updating then
insert into table_B(col_1,col_2)
values(:NEW.col_1, empty_blob())
return col_2 into l_blob;
dbms_lob.copy(l_blob,new.col_2,dbms_lob.getlength(new.col_2),1,1);
end if;
end;
BEFORE DELETE OR UPDATE
ON table_A
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
as
l_blob blob;
begin
if updating then
insert into table_B(col_1,col_2)
values(:NEW.col_1, empty_blob())
return col_2 into l_blob;
dbms_lob.copy(l_blob,new.col_2,dbms_lob.getlength(new.col_2),1,1);
end if;
end;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-483889/,如需轉載,請註明出處,否則將追究法律責任。