Created
November 20, 2008 18:32
-
-
Save snaka/27133 to your computer and use it in GitHub Desktop.
export sequence from Oracle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set linesize 200 | |
set pagesize 0 | |
set trimspool on | |
set heading off | |
set feedback off | |
spool /tmp/impSeq.sql | |
select '-- delete sequence' from dual; | |
select 'DROP SEQUENCE ' || SEQUENCE_NAME || ';' from USER_SEQUENCES; | |
select '-- create sequence' from dual; | |
select 'CREATE SEQUENCE ' || SEQUENCE_NAME || | |
' START WITH ' || LAST_NUMBER || | |
' INCREMENT BY ' || INCREMENT_BY || | |
' MINVALUE ' || MIN_VALUE || | |
' MAXVALUE ' || MAX_VALUE || | |
case CYCLE_FLAG when 'Y' then ' CYCLE' else ' NOCYCLE' end || | |
' CACHE ' || CACHE_SIZE || ';' | |
from USER_SEQUENCES; | |
select 'quit' from dual; | |
spool off | |
quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment