Solved

View sequence definition

Posted on 2004-04-23
8
9,055 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
Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
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…
Suggested Courses

626 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