我从这个触发器中遇到问题
create or replace trigger HAPUS_PENDUDUK
after delete on system.PENDUDUK
for each row
BEGIN
insert into penduduk_backup values (
old_nip , old_nama, nama_user, tanggal_perubahan || old: nip, old: nama,
current_user, sysdate()
);
END;
运行后写道:
Error(5,3): PL/SQL: SQL Statement ignored
Error(5,94): PL/SQL: ORA-00917: missing comma
但是我无法理解错过逗号的地方,并且忽略了这一规定。
答案 0 :(得分:1)
您没有正确引用OLD
列:
create or replace trigger HAPUS_PENDUDUK
after delete on system.PENDUDUK
for each row
BEGIN
insert into penduduk_backup values (
old_nip , old_nama, nama_user, tanggal_perubahan || :OLD.nip, OLD.nama,
current_user, sysdate()
);
END;