n1116,徐州双胞胎饲料,芒果娱乐网
drop table base_list;
create table base_list (
“data_list_id” number not null ,
“base_data_id” number not null ,
“base_data_list” varchar2(100 byte) not null ,
“flag” number default 0 not null
)
logging
nocompress
nocache
create sequence seq_data_list_id– seq_data_list_id 自动增长列
increment by 1 – 每次加几个
start with 1 – 从1开始计数
nomaxvalue – 不设置最大值
nocycle – 一直累加,不循环
nocache
create or replace trigger “bsqam1”.”t_data_list_id” before insert on “bsqam1”.”base_list” referencing old as “old” new as “new” for each row
begin
—在新增之前将自增的主键字段的值赋值为sequence的nextval
select seq_data_list_id.nextval into :new.data_list_id from dual;
end;
–使用alter table创建外键
alter table certificate
add constraint f_user_id
foreign key (user_id)
references tuser(user_id);
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Oracle字符串函数length、upper、lower、initcap、 concat、instr、replace
网友评论