Hello,

We are using version 8.1.6 on NT4. I have creatd sequence with cache 100 increment by 1 nocycle parameters. While inserting records through procedure it's giving me error saying 'ORA-001 Unique Constraint voilated'. I have checked following things...

SQL> select max(to_number(NO2)) from Table;

MAX(TO_NUMBER(No2))
----------------------
46727

SQL> select last_NUMBER from dba_sequences where sequence_name='NO2';

LAST_NUMBER
-----------
46729

SQL> select No2.currval from dual;

CURRVAL
----------
46728


CREATE OR REPLACE PROCEDURE PROINSREC IS
INSSTMT Varchar2(200);
Cnt Number :=0;
BEGIN
While Cnt <20000 Loop
INSSTMT := 'Insert into Table (No2,Name) values (No2.nextval,''Ein1'')';
Execute Immediate INSSTMT;
Commit;
Cnt := Cnt + 1;
End Loop;
END PROINSREC;

Please Suggest remedy for this problem. Is this a problem of caching???

Thanks & Regards
Shailesh