I am not familiar with Application Engine or PeopleCode but inherited this project when someone left. Seems simple but I'm not sure how to approach it.
I have to load a CSV file that has 5 fields. The last field has multiple values separated by a comma and it is qualified with quotes.
file example:
ID , YEAR, VALUE1 , VALUE2, CODE
87778, 2022, processed, none , 100,40
93332, 2022, processed, none , 60
76633, 2022, error , none , 55,35,9
I have created a File Layout definition and set the qualifier and I can load the file into a staging table but now I want to split the last column (CODE
) into individual codes.
I have created 2 PeopleTools Record definitions with a parent/child relationship:
- parent Record definition with
ID,YEAR,VALUE1,VALUE2
, and - child Record definition with
ID,YEAR,CODE
I have found that I can use the PeopleCode split function to break the CODE
column out into an array containing each value in an element. I'm not sure what the best way to structure the program is though.
- Is the staging table necessary?
- Or can I use the split function as I read the CSV file in and update the parent/child tables?
- Or do I need to keep the staging table and then read out the fields for the parent record and move them to the permanent table and then do the same for the child after using the split function and then loop through the array?
Just looking for some guidance so my first AE project is not a mess.