Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle set sequence value to max(id)

SELECT LAST_NUMBER FROM ALL_SEQUENCES WHERE SEQUENCE_NAME = 'seq_name';

ALTER SEQUENCE seq_name INCREMENT BY 100;	-- Value to reach desired value - 1
SELECT seq_name.nextval FROM dual;			-- Reinitialize value to desired
ALTER SEQUENCE seq_name INCREMENT BY 1;		-- Back to init step
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle alter sequence nextval 
Sql :: sql decrement value by 1 if not null or zero 
Sql :: SQL Integer devision 
Sql :: extract month from date sql two digits 
Sql :: t-sql disable system versioning 
Sql :: how much every mysql database record takes from diskspace 
Sql :: sql change table name 
Sql :: oracle user tables 
Sql :: mysql strict_trans_tables 
Sql :: restart identity cascade 
Sql :: sqlite create integer column with limit 
Sql :: sql copy table structure 
Sql :: mysql random number between 1 and 100 
Sql :: delete entries in postgresql 
Sql :: for loop postgresql 
Sql :: age postgres 
Sql :: oracle get nls settings 
Sql :: sql output inserted id 
Sql :: mssql get all table names 
Sql :: postgres get database encoding 
Sql :: mysql show all tables 
Sql :: mysql int range 
Sql :: oracle current date plus 1 month 
Sql :: how to delete table sqlite 
Sql :: mysql reset auto increment id 
Sql :: login to database mysql terminal 
Sql :: oracle add column with default value 
Sql :: mariadb.service: Main process exited, code=exited, status=1/FAILURE 
Sql :: sql last 3 rows 
Sql :: mysql how to subtract dates 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =