日期:2014-05-17 浏览次数:20737 次
SQL> create table a001(id number,udate date);
Table created.
SQL> create or replace trigger tri
2 before insert or update on a001
3 for each row
4 begin
5 :new.udate := sysdate;
6 end;
7 /
Trigger created.
SQL> show error
No errors.
SQL> insert into a001(1,sysdate);
insert into a001(1,sysdate)
*
ERROR at line 1:
ORA-00928: missing SELECT keyword
SQL> insert into a001 values (1,sysdate);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from a001;
ID UDATE
---------- ------------
1 09-OCT-12
SQL> alter session set nls_date_format='yyyy/mm/dd hh24:mi:ss';
Session altered.
SQL> select * from a001;
ID UDATE
---------- -------------------
1 2012/10/09 22:49:39
SQL> update a001 set id=2;
1 row updated.
SQL> commit;
Commit complete.
SQL> select * from a001;
ID UDATE
---------- -------------------
2 2012/10/09 22:53:12
SQL>