I have a data mapper. Input schema is excel file and output schema is database schema. Excel file has many column out of which I want to map 2 columns. Correct_brc_num and incorrect_brc_num
I want to update database column brc_num with correct_brc_num where brc_num = incorrect_brc_num
We don't have a primary key column on input excel schema. Its ok if it updated any/many records that has incorrect_brc_num with the correct one.
Please follow the instructions within the attached document to achieve your requirements. For your reference, the scenario mentioned here has no primary key on the basis of which Data Mapper can perform update on the database. It is necessary to have at least one field in target that can be considered as the key for update operations.
Otherwise, you'll have to use the data mapper utility custom class methods to perform direct SQL operations on the database against the source records without actually generating the target schema and that is why we are not using Data Mapper’s standard approach.
Article is closed for comments.