oracle序列 自动增加
2011-08-29 15:43
211 查看
普通用户普通身份
create user yao identified by "654321"
grant connect,resource to yao
conn yao/654321
create table TP
(
ProID NUMBER primary key,
ProName VARCHAR2(20)
);
创建序列
create sequence SE
minvalue 1
maxvalue 9999999
start with 1
increment by 1
NOCYCLE
NOCACHE;
创建触发器
create or replace trigger tp_se
before insert on TP
for each row
begin
select se.nextval into:new.ProID from dual;
end;
插入数据
insert into TP values (1,'aa')
insert into TP (ProName) values ('bb')
create user yao identified by "654321"
grant connect,resource to yao
conn yao/654321
create table TP
(
ProID NUMBER primary key,
ProName VARCHAR2(20)
);
创建序列
create sequence SE
minvalue 1
maxvalue 9999999
start with 1
increment by 1
NOCYCLE
NOCACHE;
创建触发器
create or replace trigger tp_se
before insert on TP
for each row
begin
select se.nextval into:new.ProID from dual;
end;
插入数据
insert into TP values (1,'aa')
insert into TP (ProName) values ('bb')
相关文章推荐
- oracle增加主键列,创建序列,并自动根据序列设值,创建触发器。
- day12_序列——oracle主键自动增加
- ORACLE 实现自动增长::序列
- 在oracle中sequence就是序号,每次取的时候它会自动增加。sequence与表没有关系
- 用代码来实现oracle自动增加1功能
- oracle设置自动增长序列
- 在Oracle中插入一行,能不能自动产生一个唯一的序列数作为主键的值
- oracle创建表,序列,触发器,自动生成唯一主键
- oracle 创建自动增加主键的表
- Oracle 创建自动增加主键的表
- [沫沫金原创]Oracle创建按天自动分区并增加按列值子分区的实现方法
- oracle创建表,追加备注,添加主键,触发器,自动增长序列
- ORACLE自动递增--序列
- oracle 手动增加序列值
- oracle 实现表中某个字段的自动增加(相当于有些数据库的自增列)
- oracle中实现主键的自动增加(csdn)
- Oracle 触发器和序列的创建和使用 (自动增长列)
- oracle中实现主键的自动增加
- oracle建表的时候让其id自动增加
- asp.net中给Gridview控件增加自动序列模板列代码