Thursday, November 7, 2013

Sequences in Oracle.

A Sequences in oracle are always operated in a Atomic operation. (Its very imp to be this way)

How to alter a sequence by advancing it by specified account

DECLARE
temp NUMBER := 0;
BEGIN
FOR idx IN 1..80000 LOOP
select seq.nextval into temp from dual;
END LOOP;
END;
/

Why do you need to do this?
The above statement requires only DML permissions, where as an ALTER statement requires DDL permissions.

No comments:

Post a Comment