There is a sequence with min value 100.
I want to alter this sequence to min value as 101.
If the table has already data in the sequence column as
100,101,102...
Is it possible to do so ?

Answers were Sorted based on User's Feedback



There is a sequence with min value 100. I want to alter this sequence to min value as 101. If the ..

Answer / kiran kumar

The START WITH Value can not changed using ALTER SEQUENCE
command. The sequence must be dropped and recreate a
sequence in different number.

Is This Answer Correct ?    20 Yes 1 No

There is a sequence with min value 100. I want to alter this sequence to min value as 101. If the ..

Answer / ranvijay

we can only alter MINVALUE,MAXVALYE,Incremented by and
CACHE of sequence.but not alter START WITH.

Alter sequence sequanceName
incremented by 2
minvalue 101;

Is This Answer Correct ?    6 Yes 4 No

There is a sequence with min value 100. I want to alter this sequence to min value as 101. If the ..

Answer / pradeep

Or other way around can be rename the current sequence and
create new sequence with the desired values;

SQL> CREATE SEQUENCE SEQ_TET INCREMENT BY 1 START WITH 100
MAXVALUE 1000000 MINVALUE 99;

Sequence created.

SQL> rename SEQ_TET to seq_test;

Table renamed.


SQL> select * from user_sequences;

SEQUENCE_NAME MIN_VALUE MAX_VALUE
INCREMENT_BY C O CACHE_SIZE
------------------------------ ---------- ---------- -------
----- - - ----------
LAST_NUMBER
-----------
SEQ_TEST 99
1000000 1 N N 20
100

Is This Answer Correct ?    1 Yes 1 No

There is a sequence with min value 100. I want to alter this sequence to min value as 101. If the ..

Answer / lova raju allumalla

WE CANNOT ALTER A SEQUENCE START NUMBER BUT IF U WANT TO
CHANGE THE EXISTING DATA IN THE TABLE THEN

ASSUME U HAVE EMPLOYEE TABLE WHERE EMPNO BEGINS WITH 100


UPDATE EMPLOYEE SET EMPNO = EMPNO + 1 WHERE EMPNO IN
(SELECT EMPNO FROM EMPLOYEE);

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

Describe types of sql statements?

0 Answers  


What are some predefined exceptions in pl/sql?

0 Answers  


what does it mean to have quoted_identifier on? : Sql dba

0 Answers  


What is your daily office routine?

0 Answers   Data Vision,


What are the different types of a subquery?

0 Answers  






what is meant by urlencode and urldocode? : Sql dba

0 Answers  


What is the use of prepared statement?

0 Answers  


need to split a string into seperate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,b,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.

1 Answers  


The in operator may be used if you know the exact value you want to return for at least one of the columns.

0 Answers  


what is julian date in oracle

2 Answers  


What is difference between stored function and application function?

0 Answers  


Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not having fixed count in between of string. I want the output to have string with one dot between. I.e. A.B.C.D.E.F

6 Answers   IBM,


Categories