Home » SQL & PL/SQL » SQL & PL/SQL » Import Data, Sequence still at 1
Import Data, Sequence still at 1 [message #191634] Thu, 07 September 2006 06:46 Go to next message
mj.daly
Messages: 6
Registered: July 2006
Junior Member
Firstly, I did a search but was unable to understand some of the answers and whether they would help me or not.

I have a newly created table, the primary key has a sequence created so it can be incremented. I have imported data into this table and the last primary key is 70, but the sequence is still at 1. How should I update the sequence to the current max primary key?

Regards,
Michael
Re: Import Data, Sequence still at 1 [message #191635 is a reply to message #191634] Thu, 07 September 2006 06:55 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
SQL> select test_seq1.nextval from dual;

   NEXTVAL
---------
        1
SQL> alter sequence test_seq1 increment by 69;

Sequence altered

SQL> select test_seq1.nextval from dual;

   NEXTVAL
---------
       70

SQL> alter sequence test_seq1 increment by 1;

Sequence altered

SQL> select test_seq1.currval from dual;

   CURRVAL
----------
        70
Re: Import Data, Sequence still at 1 [message #191637 is a reply to message #191635] Thu, 07 September 2006 07:13 Go to previous message
mj.daly
Messages: 6
Registered: July 2006
Junior Member
Great, simple enough!

Cheers
Previous Topic: indexes storing.
Next Topic: question on return function
Goto Forum:
  


Current Time: Wed Dec 07 20:50:29 CST 2016

Total time taken to generate the page: 0.10052 seconds