Link to home
Start Free TrialLog in
Avatar of nparthi
nparthi

asked on

View sequence definition

How do I view the sequence definition from SQL prompt?

I want to view the sequence 'definition' of a sequence that I created long ago.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

take a look at the user_sequences view.
If you are running 9i, you can use:

SQL> SELECT DBMS_METADATA.GET_DDL( 'SEQUENCE','YOUR_SEQUENCE_NAME','YOUR_SCHEMA') FROM DUAL;
Avatar of nparthi

ASKER

I am using Oracle 8
Try this select statement:

select 'create sequence '||sequence_name||
       ' increment by '||increment_by||
         ' start with '||last_number||
         ' minvalue '||min_value||
         ' maxvalue '||max_value||' ;'
from all_sequences
where sequence_name='YOUR_SEQ'
hi

the dba_sequences table in sys schema will show u all the details regarding the sequences.

regards
annamalai
ASKER CERTIFIED SOLUTION
Avatar of n4nazim
n4nazim

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial