#1 Stored procedure to rest the sequence create or replace procedure reset_seq( p_seq_name in varchar2 ) is l_val number; begin execute immediate 'select ' || p_seq_name || '.nextval from dual' INTO l_val; execute immediate 'alter sequence ' || p_seq_name || ' increment by -' || l_val || ' minvalue 0'; execute immediate 'select ' || p_seq_name || '.nextval from dual' INTO l_val; execute immediate 'alter sequence ' || p_seq_name || ' increment by 1 minvalue 0'; end; / #2 How to reset table and the sequence create or replace procedure reset_table( tablename in varchar2 , sequenceName in varchar2) is deleteStatement varchar2(2000); re...
The reason for doing the work is to create something useful that helps people. Please click the ads if my articles are useful for you. Definitely, that's not enough. My target is working at some great organizations, such that one day, all the people with internet access can benefit from the service I contributed.