heting

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  40 随笔 :: 9 文章 :: 45 评论 :: 0 Trackbacks
create   sequence   name     
increment   
by   x   //x为增长间隔     
start   
with     x   //x为初始值     
maxvalue         x   
//x为最大值       
minvalue         x   
//x为最小值     
cycle                
//循环使用,到达最大值或者最小值时,从新建立对象     
cache            x   
//制定缓存序列值的个数     
                      
------------------------一个例子-----------------------
create   sequence   for_test  --序列名     
increment   by   1     --每次增加1
start   with   1     --从1开始
nomaxvalue     --没有最大值
nocache        --没有缓存序列

----------------------------创建测试表------------------
create table Test
(
TestID 
int primary key,
TestName 
varchar2(20not null,
Tdescription 
varchar2(200null
)

-----------------------------使用序列-------------------
insert into Test
values(for_test.nextval,'序列测试','这是一个序列使用的例子')

--------------------序列使用结果查询-----------------
select * from test
posted on 2009-03-31 13:57 贺挺 阅读(142) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: