Quick Search:
 
 Oracle PL/SQL: SEQUENCE: get sequence value into variable Jump to:  
Category: >> Oracle PL/SQL >> SEQUENCE: get sequence value into variable  

<< lastnext >>

Snippet Name: SEQUENCE: get sequence value into variable

Description: Oracle doesn't let you use sequences directly from PL/SQL. This is how to get a sequence value into a PL/SQL variable.

Also see:
» SEQUENCE: Demo code and Examples
» Declaring Variables
» SEQUENCE: Find sequence MAX value
» SEQUENCE: Reset a sequence to a predef...
» SEQUENCE: get sequence value into vari...
» SEQUENCE: Autonumber into two tables
» SEQUENCE: Create sequence demo
» Create Sequence
» Anonymous blocks: Constants and Variab...

Comment: (none)

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 06th, 2009

-- you cannot use sequences directly from PL/SQL. 
-- Oracle prohibits this type of usage: 
 
i := sq_sequence.NEXTVAL;  - won't work!
 
 
-- but you can use embedded SQL statements to 
-- obtain sequence values:
 
select sq_sequence.NEXTVAL into :i from dual; -- works
 


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org