编辑:这里的每个请求是 SQL*Plus 中发生的事情 编辑 2:问题是列名是关键字 SQL> 删除表注释;
Table Dropped.
SQL> create table comments (
2 comment_id number not null,
3 post_id number not null,
4 user_id number not null,
5 message varchar2(2500) not null,
6 timestamp timestamp(6) not null);
Table Created
SQL> create sequence comment_seq
2 start with 1
3 increment by 1
4 nomaxvalue;
Sequence Created
SQL> ed
Wrote file afiedt.buf //NOTEPAD OPENED UP
1 create or replace trigger comment_trigger
2 before insert on comments
3 for each row
4 begin
5 select comment_seq.nextval
6 into :new.comment_id
7 from dual;
8 end;
SQL> /
ERROR at Line 2:
ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-320: the declaration of the type of this expression is
incomplete or malformed
SQL> show errors
No errors.