Skip to main content

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

@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