我正在尝试创建一个触发器,该触发器将记录审计表中表的任何删除
触发器如下所示:
create or replace TRIGGER cusdelete
AFTER
DELETE OR UPDATE
ON CUSTOMER
DECLARE
v_username varchar2(10);
BEGIN
SELECT V('APP_USER')
INTO v_username
FROM dual;
-- Insert record into audit table
INSERT INTO cusudit
( CUSTOMER_id,
country,
first_name,
last_name,
birth_date,
address,)
VALUES
(old.CUSTOMER_id,
old.country,
old.first_name,
old.last_name,
old.birth_date,
old.address,
sysdate,
v_username );
END;
但是,当我尝试保存和编译它时,我收到以下消息:
*Compilation failed, line 20 (15:29:04) The line numbers associated with compilation errors are relative to the first BEGIN statement.
This only affects the compilation of database triggers.
PLS-00049: bad bind variable 'OLD.QUANTITY'Compilation failed, line 21 (15:29:04)
The line numbers associated with compilation errors are relative to the first BEGIN statement.
This only affects the compilation of database triggers.
PLS-00049: bad bind variable 'OLD.COST_PER_ITEM'Compilation failed, line 22 (15:29:04)
The line numbers associated with compilation errors are relative to the first BEGIN statement.
This only affects the compilation of database triggers.
PLS-00049: bad bind variable 'OLD.TOTAL_COST'*