Find Sequence MAX Value

How to find the max value in a Sequence?

Questions by pc_mts

Showing Answers 1 - 15 of 15 Answers

ravi.8311

  • Jun 28th, 2008
 

crete sequence<sequnce name)
increment by(no.val>
startwith<no. val>
max val<no.val>
cycle
cache);
suppose we  give starting value 101 and give max value 1000,it t start at 101 and end with 1000 values.

  Was this answer useful?  Yes

We can get the MAX value of a sequence by using the data dictionary view

'USER_SEQUENCES' .


i.e.  SELECT MAX_VALUE FROM USER_SEQUENCES
       WHERE SEQUENCE_NAME='NAME_OF_SEQUENCE'

  Was this answer useful?  Yes

mstreete

  • Sep 29th, 2008
 

If you don't own the sequence, you may look at all_sequences, which shows sequences in other schemas that you have access to:select max_valuefrom sys.all_sequenceswhere sequence_owner = '&sequence_owner' and sequence_name = '&sequence_name'

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions