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!

Reset sequence to 1

Azadare MApr 29 2014 — edited Apr 30 2014

Hi All,

I have a table and I created a seq on that table...

And I deployed table to production. now the requirement is when user delete all records from that table then automatically my created seq should set to 1.

Ex : I have table test and sequencer seq_test and my seq_test start with 1 and increment by 1.  now after inserting lot of records m suppose user inserted 100 records then my sequence reached to 100 as well,

if suppose user deletes all records from table and he/she wants to insert new records after delete all records at that time seq_test should start with 1..

How can I achieve this...I guess trigger wont works here bec.. trigger wont allow ddl statments like alter sequence...

is there any another way?

thanks

This post has been answered by Azadare M on Apr 29 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2014
Added on Apr 29 2014
20 comments
1,658 views