How To Split Employee Records Into Two Tables Using EsProc And Java
Divide CSV records into two tables: EMP (newest employees) and EMP_HIS (historical records). Use esProc script p1.dfx to group by EMPID, get latest UPDATEDATE values, and update or insert records into database.
Problem description & analysis Below is CSV file emp.csv: EMPID,FIRSTNAME,LASTNAME,EMAIL,UPDATEDATE 123,John,Smith,john.smith01@email.com,01/01/2020 234,Bruce,Waye,bruce.wayne@wayneenterprises.com,02/02/2020 123,John,Smith,john.smith02@email.com,02/15/2020 345,Clark,Kent,clark.kent@dailyplanet.com,02/16/2020 123,John,Smith,john.smith03@email.com,02/20/2020 In the above file, UPADATEDATE field is ordered and EMPID field contains duplicates. We are trying to divide records in the CSV file into two parts: Write the newest employee records, which are those with the latest UPDATEDATE values after...