select 'drop sequence '||SEQUENCE_NAME||';'
from user_sequences;
SELECT 'create sequence '||SEQUENCE_NAME||' minvalue '||min_value
||' maxvalue '||MAX_VALUE||' start with '
||case when INCREMENT_BY > 0 then min_value else MAX_VALUE end
||' increment by '||INCREMENT_BY||' '
||case when CACHE_SIZE = 0 then 'nocache' else 'cache '||CACHE_SIZE end||' '
||case when nvl(CYCLE_FLAG,'0') ='Y' then 'cycle' else '' end||' '
||case when nvl(ORDER_FLAG,'0') ='Y' then 'order' else '' end||';'
FROM user_SEQUENCES;