Solved

View sequence definition

Posted on 2004-04-23
8
8,738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 77

Expert Comment

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

Expert Comment

by:dbms_chu
ID: 10902403
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
ID: 10902606
I am using Oracle 8
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:dbms_chu
ID: 10903057
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
ID: 10905771
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
ID: 10906275
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

730 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