大家看看我哪些错了谢谢!

warword0 2009-01-19 04:55:54
create table bbs_class (
cid number primary key, --版面id,自增
title varchar2(30) not null --版面名称
);

--bbs_class 中cid 序列
CREATE SEQUENCE cid_seq
INCREMENT BY 1
START WITH 1
NOMAXVALUE
NOCYCLE
NOCACHE;

--bbs_class 中cid触发器
create or replace trigger cid_trig
before insert on bbs_class for each row
begin
if inserting then
select cid_seq.nextval into:new.id from dual;
end if;
end;
/

然后创建触发器时报:Warning: Trigger created with compilation errors,用时报:触发器无效!
...全文
106 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yoyo82 2009-01-22
  • 打赏
  • 举报
回复
触发器 慎用。。。
netsocket 2009-01-22
  • 打赏
  • 举报
回复
mark
mizukusa 2009-01-22
  • 打赏
  • 举报
回复
不会,帮顶!
L502650 2009-01-22
  • 打赏
  • 举报
回复
每日一水...
tubage408 2009-01-19
  • 打赏
  • 举报
回复
before insert on bbs_class for each row;
ty_fzpb 2009-01-19
  • 打赏
  • 举报
回复
发错地方了

不是DBA尽量不要使用触发器

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧