Oracle中的序列号顾名思义就是创建一个序列号,可以在插入或者更新的时候调用,相当于是一个生成器
创建语法:
create sequence myse
increment by 1 --增长度
start with 1 --从哪里增加,就是说下一个获取的值从这个值开始
nomaxvalue --不设置最大值 对应的:maxvalue 30、
order --指定一定往下增加
nocycle --不循环,CYCLE和NOCYCLE 表示当序列生成器的值达到限制值后是否循 环
cache 10 --CACHE(缓冲)定义存放序列的内存块的大小,默认为20。NOCACHE表示不对序列进行内存缓冲。对序列进行内存缓冲,可以改善序列的性能
修改:
序列的某些部分也可以在使用中进行修改,但不能修改SATRT WITH选项。对序列的修改只影响随后产生的序号,已经产生的序号不变。修改序列的语法如下:
ALTER SEQUENCE emp_sequence
INCREMENT BY 10
MAXVALUE 10000
CYCLE -- 到10000后从头开始
NOCACHE ;
需注意:
第一次NEXTVAL返回的是初始值;随后的NEXTVAL会自动增加你定义的INCREMENT BY值,然后返回增加后的值。CURRVAL 总是返回当前SEQUENCE的值,但是在第一次NEXTVAL初始化之后才能使用CURRVAL,否则会出错。一次NEXTVAL会增加一次SEQUENCE的值,所以如果你在同一个语句里面使用多个NEXTVAL,其值就是不一样的。
删除:
DROP SEQUENCE order_seq;
http://essay.iteye.com/blog/437201
分享到:
相关推荐
我们可以在 Vue.js 的官网上直接下载 vue.min.js 并用 <script> 标签引入。 格式就是: <script src="./js/vue%20(1).js" type="text/javascript" charset="UTF-8"></script> src里面的内容根据自己的下载的Vue.js的...
Contents<br>Section I Fundamentals<br>Chapter 1 Introduction<br>1.1 Practical Needs for Image and Video Compression<br>1.2 Feasibility of Image and Video Compression<br>1.2.1 Statistical Redundancy<br...
The 80x86 MOV Instruction<br>4.8 - Some Final Comments on the MOV Instructions<br><br>4.9 Laboratory Exercises<br>4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers<br>4.9.2 ...
<Sequence>1</Sequence> </Record> <Record> <Data> <DoubleData>10.26</DoubleData> <StrData>two</StrData> <DateData>2010-10-26</DateData> </Data> <Sequence>2</Sequence> </Record> </Demo>
19.zip<br>Disable clicking on selected report view columns<br>禁止鼠标在列表视图单击(2KB)<END><br>10,21.zip<br>Dragging columns to rearrange column sequence<br>重新排列次序(6KB)<END><br>11,22.zip<br>...
<CR><LF>M5310-A<CR><LF>OK<CR><LF> After this string has been received the AT Command processor is ready to accept AT commands. If the Applications core was rebooted or restarted for any reason that ...
<br> }<br>}<br>1) a sequence of 5 0’s will be printed<br>2) Error:ar is used before it is initialized<br>3) Error Mine must be declared abstract<br>4) IndexOutOfBoundes Error<br>19、编译和执行下例...
message will be output before the <CR><LF>Neul<CR><LF>OK<CR><LF> string. See Chapter 7 for more details. In case external MCU intervene the process of update, unsolicited information informs the ...
winhole.zip<br>This example demonstrates how to put a hole in the center of a form.<END><br>15 , tileform.zip<br>This will tile a picture on the background of your form.<END><br>16 , radiomnu.zip<br>...
All operations can be done with the mouse only or using hotkeys.<br> Allows timed captures in sequence at a pre-defined interval(Timer).<br> Precise capturing using magnifying tools and extra large ...
<br>Pku acm 1179 Polygon<br>Pku acm 1125 Stockbroker Grapevine<br>Pku acm 1160 post office...Sequence<br>Pku acm 1579 Function Run Fun <br>Pku acm 1157 LITTLE SHOP OF FLOWERS<br>Pku acm 1163 the Triangle
calip.zip<br>A calculator application that allows the user to enter two numbers and them select the operator (^,*,+,-,/,\,mod) <END><br>8,Generator.zip<br>This is a Fibonacci Sequence Generator....
第一章 针对Java程序员的UML概述<br>第二章 使用图(Diagrams)<br>第三章 类(Class)图<br>第四章 序列(Sequence)图<br>第五章 用例(use case)<br>第六章 面向对象设计(OOD)原则<br>第八章 包(Packages)<br>第九章 ...
- `<digit>` 和 `<digit_sequence>` 分别代表数字字符和数字序列,用于构成整数或实数。 - `<for>` 和 `<to>` 在循环结构中使用,如`for i := 1 to 10 do ...`。 - `<function>` 和 `<procedure>` 定义函数和过程...
UML教程<br>4e-01UML概述.ppt<br>4e-02use case.ppt<br>4e-02use case补充内容.ppt<br>4e-03sequence-collaboration.ppt<br>4e-04class-object-package.ppt<br>4e-05状态-活动-构件-配置图.ppt<br>4e-06Web建模.ppt...
* Renamed assembly to ByteFX.MySqlClient.dll<br> *...* Added GUID support<br> * Fixed sequence out of order bug (thanks Mark Reay)<br> * And many more improvements that I can't think of right now....<br>
3. **<sequence>** / **<flow>**: - **<sequence>** 保证活动按照顺序执行,一个活动完成后才执行下一个。 - **<flow>** 允许并行执行多个活动,它们可以同时进行。 4. **<link>** / **<source>** / **<target>*...
```ip access-list extended {<number> | <name>} [<sequence>] {permit | deny} <protocol> <source> [<ports>] <destination> [<ports>] [<options>]``` 在这个扩展版本中,`<number>`范围为100-199(扩展列表)或...
CREATE SEQUENCE seq_<序列名> START WITH 1 INCREMENT BY 1 MAXVALUE 1000000 CACHE 20 NOCYCLE; ``` 创建一个从1开始递增的序列,最大值为1000000,缓存20个值,不循环。 2. **使用序列:** ```sql ...
<xs:sequence> <xs:element name="grade"> <xs:complexType> <xs:sequence> <xs:element name="class"> <xs:complexType> <xs:sequence> <xs:element name="student"> <xs:complexType> <xs:sequence> ...