数据库表、序列以及触发器的创建

来源:互联网 发布:品茗造价软件 编辑:程序博客网 时间:2024/06/05 15:39

create table sgcc_tel_list(
id number(6),
name varchar2(10),
office varchar2(20),
off_tel varchar2(15),
moblie varchar2(15),
short_mobile varchar(10),
office_id varchar2(10),
inner_mail varchar2(20),
remark varchar2(30),
style varchar2(10)

)

create sequence sgcc_tel_list_seq
increment by 1
start with 1
nomaxvalue
nominvalue
nocache //无缓存

create or replace trigger sgcc_tel_list
before insert on sgcc_tel_list
for each row
begin
select sgcc_tel_list_seq.nextval into :new.id from dual; //from dual 只是为了满足sql语句标准,nextval是规定写法
end;

0 0