--建立表:
create table simon_example
(
id number(4) not null primary key,
name varchar2(25)
)
-- 建立序列:
-- Create sequence
create sequence SIMON_SEQUENCE
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;
-- 建立触发器
create trigger "simon_trigger" before
insert on simon_example for each row when(new.id is null)
begin
select simon_sequence.nextval into:new.id from dual;
end;
建SEQUENCE序列
CREATE SEQUENCE 序列名字(例如:"URLIMAGE_SEQ") MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 101 CACHE 10 NOORDER NOCYCLE ;
建trigger 触发器
create or replace trigger 触发器名字(例如:URLIMAGE_TRI )
before insert
on 映射的表名(例如:URLIMAGE &
create table simon_example
(
id number(4) not null primary key,
name varchar2(25)
)
-- 建立序列:
-- Create sequence
create sequence SIMON_SEQUENCE
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;
-- 建立触发器
create trigger "simon_trigger" before
insert on simon_example for each row when(new.id is null)
begin
select simon_sequence.nextval into:new.id from dual;
end;
建SEQUENCE序列
CREATE SEQUENCE 序列名字(例如:"URLIMAGE_SEQ") MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 101 CACHE 10 NOORDER NOCYCLE ;
建trigger 触发器
create or replace trigger 触发器名字(例如:URLIMAGE_TRI )
before insert
on 映射的表名(例如:URLIMAGE &