Solved

View sequence definition

Posted on 2004-04-23
8
8,946 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example, show how to take different types of Oracle backups using RMAN.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

729 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