当前位置:网站首页>oracle之序列
oracle之序列
2022-06-12 02:43:00 【zhu0902150102】
CREATE SEQUENCE SEQUENCE_NAME/*序列名*/
INCREMENT BY 步长(步长为正是递增,为负时递减,默认1)
START WITH A(初始值)
MAXVALUE B(最大值)
MINVALUE C(最小值)
CYCLE/NOCYCLE(是否循环)
CACHE D/NOCACHE;(是否分配缓存)
用sequence_name.nextval获得下一个序列值;
用sequence_name.currval获得当前序列值
举例
通过序列给一个stud表的sno赋值
create table stud(sno number,age number);
create sequence stud_seq
start with 1
maxvalue 9
minvalue 1
nocycle
nocache;
create or replace procedure stud_add
is
age number default 10;
begin
for id in 1..9 loop
insert into stud values(stud_seq.nextval,age);
end loop;
end;
边栏推荐
- Bochuang smart sprint technology innovation board: annual revenue of RMB 1.1 billion, book value of accounts receivable of RMB 300million
- DbNull if statement - DbNull if statement
- Force deduction solution summary 732- my schedule III
- 代理与反射(二)
- Selection (045) - what is the output of the following code?
- Unique paths for leetcode topic resolution
- Selection (043) - which of the following values are false?
- ZABBIX notes: 6.0 lts source code installation
- Force deduction solution summary -04.06 Successor
- 1 minute to understand the essential difference between low code and zero code
猜你喜欢

Apply concentrated load to nodes in batch in ABAQUS

Comment prévenir les incendies électriques dans les centres commerciaux?

Oracle 11g graphic download installation tutorial (step by step)

【高代码文件格式API】道宁为您提供文件格式API集——Aspose,只需几行代码即可创建转换和操作100多种文件格式

如何防止商场电气火灾的发生?

Bochuang smart sprint technology innovation board: annual revenue of RMB 1.1 billion, book value of accounts receivable of RMB 300million

Query the duplicate values of multiple fields in the database, output the number, and add them.

一起教育科技单季营收2.3亿:同比降51% 净亏大幅收窄

El upload upload file

代理与反射(二)
随机推荐
Add sequence number column to MySQL query result set
小红的删数字
Force deduction solution summary 449 serialization and deserialization binary search tree
Force deduction solution summary 433- minimum gene change
How to use DAO to build a knowledge database with collective wisdom and sustainable incentive mechanism
Force deduction solution summary 450- delete nodes in the binary search tree
Force deduction solution summary 953 verification of alien language dictionary
cupp字典生成工具(同类工具还有crunch)
【高代码文件格式API】道宁为您提供文件格式API集——Aspose,只需几行代码即可创建转换和操作100多种文件格式
Force deduction programming problem - solution summary
Force deduction solution summary 668- the smallest number k in the multiplication table
[digital signal processing] correlation function (periodic signal | autocorrelation function of periodic signal)
The four pain points of enterprise digitalization are solved by low code platform
Research Report on Chinese psoriasis drug market evaluation and investment direction (2022 Edition)
The market value has exceeded $3trillion. Why should apple, which has been criticized as a loser, rise again and again?
What is SAP c/4hana Foundation
Query the duplicate values of multiple fields in the database, output the number, and add them.
Application of acrelcloud-6000 secure power cloud platform in a commercial plaza
Force deduction solution summary 473 match to square
[digital signal processing] correlation function (energy signal | cross correlation function of energy signal | autocorrelation function of energy signal)