SAP Knowledge Base Article - Preview

3738933 - UPSERT Fails with Unique Constraint Violated After Upgrading to CDS v9

Symptom

After upgrading @sap/cds from version 8 to version 9, an UPSERT.into(...).entries(...) operation fails with the following error:

   unique constraint violated: ... Index(_SYS_TREE_CS_...) ... key=... already exists

Note:

The same code works without errors on CDS v8.


Read more...

Environment

SAP Cloud Application Programming Model: CDS v8 and v9

Product

SAP Cloud Application Programming Model all versions

Keywords

CAP, CDS, UPSERT, @sap/cds, @cap-js/hana, unique constraint violated, unique constraint, UPSERT entries, duplicate primary key, bulk upsert, CDS v8, CDS v9, CDS upgrade, migration, HANA Cloud, JSON_TABLE, column store, HDI, UPSERT.into, entries, flat, array , KBA , BC-XS-CDX-NJS , SAP CAP – node.js runtime , HAN-CLS-HC , HANA Cloud Services HANA Cloud , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.