How to access the current value and next value from a sequence

Showing Answers 1 - 5 of 5 Answers

kumar vikal

  • Jul 27th, 2005
 

for current value the function is :- sequence_name.currval 
and for the next value it is sequence_name.nextval

  Was this answer useful?  Yes

I would like to give you a small example to use the sequence.currval and sequence.nextval

create sequence seq_name

start with 1

minvalue 1

maxvalue 999

increment by 1

nocycle

insert into table_name (sno,name) values (seqname.nextval,'abc');

select seqname.currval from dual

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions