Skip to main content

Posts

Showing posts with the label sequence

The the knowledge I learned when worked on the oracle data migration - Part 1

#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...