Solved

Sequence Number Generation(FSM)

  • 17 February 2021
  • 1 reply
  • 289 views

Userlevel 4
Badge +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

icon

Best answer by AdrianEgley 17 February 2021, 16:52

View original

This topic has been closed for comments

1 reply

Userlevel 5
Badge +14

@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