I have one SQL that fetch big number of rows and then insert to database all in one iteration.
INSERT INTO Summary (Name,StartDate,EndDate,InitialSize,Completed,Remaining) SELECT (Status.Type + ' ' +Status.Generic) AS Name,DATEADD(day, -28, Status.Pat2) AS StartDate, DATEADD(day, 1, Status.Pat2) AS EndDate, COUNT(*) AS InitialSize, SUM(CASE WHEN Status.sw = 'Y' THEN 1 ELSE 0 END) AS Completed, SUM(CASE WHEN Status.sw = 'Y' THEN 0 ELSE 1 END) AS Remainig FROM .......
jdbcTemplate.batchUpdate(sql);
How can I make this to be faultTolerant meaning if there is exception due to duplicate key (column Name) then insert will continue without the duplicate row.
Thanks you