Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

View sequence definition

Posted on 2004-04-23
8
Medium Priority
?
9,333 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
Technology Partners: 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 80 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

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.  …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

688 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