on 2021 Mar 15 7:20 PM
1. I am trying to bulk insert records using the following query:
DAO.INSERT.into(entity).entries(toInsert)
2. But I end up with the following error:
{"code":400,"message":"ENTITY_ALREADY_EXISTS","numericSeverity":4}
even though there are no duplicates in the table
Request clarification before answering.
Hi Mujeeb,
thanks for providing context.
You most probably are using some 'unique' constraint in your DDL (e.g., `@assert.unique` in CDL) and there is an error connected with this – so some data affected by the constraint seems to be present already.
Unfortunately there is a known issue as to the original error message getting lost.
Hope these hints help you.
Regards,
Tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tim,
Thank you for the help. This hint helped me understand the root cause.
The issue was that the array which I was sent to be uploaded had a duplicate record within in. I was not aware of that and was checking on all other places as it sent ENTITY_ALREADY_EXISTS error which put me off track.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mujeeb,
please provide more context: Which products and programming language do you use and on which platform?
Regards, Tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure, Tim.
Following are the details:
1. The DB here is Hana and I am using CDS queries to update and insert data.
2. I am using Node.js
3. I am doing the development on the BAS and the services are deployed on Cloud Foundry.
To add more details here:
1. I deleted a few entries from Hana's SQL console.
2. We have an auto cron [batch job] which fetches data from C4C and then process them and updated the Hana database/
3. Fetching and proccessing is workig right but the save/update is failing with the above error.
User | Count |
---|---|
78 | |
29 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.