建立自增长序列后,再建一个触发器,然后就什么都出不来了,打回车都是空白,为什么呢?是不是还需要写其他的什么呢?感谢!
建序列代码
-- Create sequence
create sequence anumbercount
minvalue 1
maxvalue 999999999999
start with 1
increment by 1
nocache;建触发器代码
create or replace trigger bef_ins_author
before insert on author
referencing old as old new as new for each row
begin
select anumbercount.nextval into :new.anumber from dual;
end;
建序列代码
-- Create sequence
create sequence anumbercount
minvalue 1
maxvalue 999999999999
start with 1
increment by 1
nocache;建触发器代码
create or replace trigger bef_ins_author
before insert on author
referencing old as old new as new for each row
begin
select anumbercount.nextval into :new.anumber from dual;
end;
2 idx int;
3 begin
4 idx:=1;
5 loop
6 if(idx > i) then
7 exit;
8 end if;
9
10 dbms_output.put_line(idx*idx);
11 idx:=idx+1;
12
13 end loop;
14 end;
15 /过程已创建。