cancel
Showing results for 
Search instead for 
Did you mean: 

Hana Insert Into Select fails on duplicate records; duplicate should be skipped and others inserted.

Former Member
0 Kudos

Hi,

I need your help to get a solution/workaround for insert into select.

I have a cv having bulk of data.

I have to insert that data into a target table on daily basis.

for that Stored procedure is written.

and daily we are inserting using insert into select statement.

But if any record is already available in target table then unique constraint occurs.

Insert into target_table (column1,column2,column3,column4)

select column1,column2,column3,column4 from CV;

Declare exit handler is only captures the error and then comes out of the procedure.

I want to save error record in separate table and stored procedure should skip error record and continue inserting next records.

Kindly help me to implement this requirement.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

try to aggregate them (count), create a dummy column if needed.

Insert the aggregated data to your table (without dummy).
Store the records if their count number is greater than 1.

Regards,
Mateusz.