Create sequence script
I've to remove the existing sequences in a schema & then i've to recreate
those sequences with START WITH to old sequences current value.
I've written a script as follows,to recreate current sequences after droppping them,
select 'create sequence ' || sequence_name || ' start with ' ||
' increment by ' || INCREMENT_BY || ' minvalue ' || MIN_VALUE ||
' maxvalue ' || MAX_VALUE || ' CACHE ' || CACHE_SIZE || ' ' || case when cycle_flag='Y' then ' CYCLE ' end
Now the problem in this script is,I'm not able to set START WITH current values of the sequence,
I tried with LAST_NUMBER,but it doesn't work for sequence which set with CACHE option.
So,correct my script & guide me to get a script,that gives what i needed.
Obviously this has to be done when no one else is using your application.
I think all you can do is take NEXTVAL from the sequence.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Click Here to Expand Forum to Full Width