Solved

View sequence definition

Posted on 2004-04-23
8
8,210 Views
Last Modified: 2011-10-03
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.
0
Comment
Question by:nparthi
8 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
take a look at the user_sequences view.
0
 
LVL 3

Expert Comment

by:dbms_chu
Comment Utility
If you are running 9i, you can use:

SQL> SELECT DBMS_METADATA.GET_DDL( 'SEQUENCE','YOUR_SEQUENCE_NAME','YOUR_SCHEMA') FROM DUAL;
0
 
LVL 1

Author Comment

by:nparthi
Comment Utility
I am using Oracle 8
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 3

Expert Comment

by:dbms_chu
Comment Utility
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'
0
 
LVL 8

Expert Comment

by:annamalai77
Comment Utility
hi

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

regards
annamalai
0
 
LVL 2

Accepted Solution

by:
n4nazim earned 20 total points
Comment Utility
Try this

TO GET CRITICAL INFORMATION USE:


SELECT  min_value, max_value, increment_by, cycle_flag, order_flag, cache_size, last_number
FROM  dba_sequences
WHERE sequence_owner = 'SEQUENCE_OWNER'
AND sequence_name = 'SEQUENCE_NAME'                                                                              

U CAN ALSO SAY ( SELECT * ) TO GET MORE INFORMATION ON THE SEQUENCE


Rgds,
Nazim M
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now