on 04-17-2017 8:19 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.