Oracle9i on UNIX via telnet
I have dba and system rights, but working in a user account for this.
OK, so I have a table set up like:
Table_Name Null? Type
ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(20)
SALARY NOT NULL NUMBER(6)
DEPT VARCHAR2(4)
LAST_UPDATE_USER CHAR(20)
LAST_UPDATE_DATE DATE
and this trigger:
CREATE OR REPLACE TRIGGER Emp_Timestamp_bc
BEFORE Insert OR Update ON emp
REFERENCING New AS New_Row
FOR EACH ROW
BEGIN
:New_Row.Last_Update_User := USER;
:New_Row.Last_Update_Date := SYSDATE;
END Emp_Timestamp;
/
When I try to add a new row to the 'emp' table,
:SQL> insert into emp values
2 (10, 'Adam', 50000, 'MIS');
I get this error:
ERROR at line 1:
ORA-00947: not enough values
I think that means that the trigger is not firing. At a loss beyond that. Any suggestions?
Thanks,
Brian
I have dba and system rights, but working in a user account for this.
OK, so I have a table set up like:
Table_Name Null? Type
ID NOT NULL NUMBER(3)
NAME NOT NULL VARCHAR2(20)
SALARY NOT NULL NUMBER(6)
DEPT VARCHAR2(4)
LAST_UPDATE_USER CHAR(20)
LAST_UPDATE_DATE DATE
and this trigger:
CREATE OR REPLACE TRIGGER Emp_Timestamp_bc
BEFORE Insert OR Update ON emp
REFERENCING New AS New_Row
FOR EACH ROW
BEGIN
:New_Row.Last_Update_User := USER;
:New_Row.Last_Update_Date := SYSDATE;
END Emp_Timestamp;
/
When I try to add a new row to the 'emp' table,
:SQL> insert into emp values
2 (10, 'Adam', 50000, 'MIS');
I get this error:
ERROR at line 1:
ORA-00947: not enough values
I think that means that the trigger is not firing. At a loss beyond that. Any suggestions?
Thanks,
Brian