Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

can i get sequence_name.nextval dynamically

676917Dec 14 2009 — edited Dec 30 2009
In my DB i have more then 20 sequence are there i need to get all the next values

here i have written the code

please correct me
DECLARE 
v_max              NUMBER;
BEGIN

for rec in (select sequence_name from user_sequences where sequence_name='SEQ_ACHDETAILLOG')  loop

select rec.sequence_name.nextval into v_max from dual;

dbms_output.put_line(v_max);
end loop;
END;
thanks in advance
shk
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2010
Added on Dec 14 2009
5 comments
1,020 views