Skip to main content
Solved

Sequence Number Generation(FSM)

  • February 17, 2021
  • 1 reply
  • 321 views

Forum|alt.badge.img+7

Hi Community,

While updating multiple records using insert SQL command to the tab level, We are not able to generate multiple sequence(design_id ) which is the primary key and getting below error. 

 

Can anyone suggest what is the best way we can generate sequence for multiple records through SQL command. 

 

Thanks,

Ramya

Best answer by AdrianEgley

@Ramya 

This might help.

select coalesce(max(table_name.column_name),0) from table_name) + row_number() over (order by 1/0) design_id,

 

You will just need to add in your table and column names for your object.

Assuming you have a script to get some data in the first place, place this in the select where the design_id column would be.

 

But as ever. SQL / Inserting, be careful and test.

 

Ady

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

AdrianEgley
Hero (Customer)
Forum|alt.badge.img+14
  • Hero (Customer)
  • February 17, 2021

@Ramya 

This might help.

select coalesce(max(table_name.column_name),0) from table_name) + row_number() over (order by 1/0) design_id,

 

You will just need to add in your table and column names for your object.

Assuming you have a script to get some data in the first place, place this in the select where the design_id column would be.

 

But as ever. SQL / Inserting, be careful and test.

 

Ady


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings