The relevant OracleDatabaseSequence information is as follows: Create the Sequence syntax createsequencelt; schemagt;. lt; table_namegt; _ sincrement
The relevant Oracle Database Sequence information is as follows: create Sequence with the sequence Syntax: lt; schemagt;. lt; table_namegt; _ sincrement
Homepage → Database Technology
Background:
Read News
Establish and query Sequence in Oracle Database
[Date: 2010-02-04] Source: Oracle community Author: Oracle edit [Font:]
The relevant Oracle Database Sequence information is as follows:
Create Sequence syntax
Create sequence . _ S
Increment by 1
Start with 1
Max value 99999999999999999999
Minvalue 1
Nocycle;
Where:
Incerment: value added each time
Start: Sequence start value
Maxvalue: Maximum Sequence Value
Nocycle: When the Sequence reaches the maximum value, it does not start with the same Sequence.
Get the next Sequence Value
Select . Nextval [@ db_link]
From dual;
Query the current Sequence Value
Syntax 1:
Select . Currval [@ db_link]
From dual;
Mark: If "Current DB Session" has not executed nextval, run currval first.
ORA-08002: sequence DB_SESSION_ID.CURRVAL is not yet defined in this session error.
Syntax 2:
Select last_number-1
From all_sequences
Where sequence_name =' ';
Modify Sequence
For example, Alter Sequence MaxValue 999999999999999;
Notes
1) Sequence cannot be directly used after "equation: =". For example, vID: = tomSeq. nextval;
2) Sequence can be directly used in "SQL". For example: insert into tomTable values (tomSeq. nextval ,...);
0
Add Blob data type objects in Oracle
Install MySQL in Ubuntu to obtain the C interface created by mysql. h.
Oracle
Image Information
View All comments in this article (0)
Comments
Latest Information
Popular this week
Introduction to Linux community-advertisement service-website map-help Info-contact us
The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.
Copyright©2006-2014 Linux community All rights reserved Zhejiang ICP backup No. 06018118
,