2024 Sep 23 2:21 PM
Hi CAP Experts, I am working on the CAP Tutorial https://developers.sap.com/tutorials/cp-apm-nodejs-create-service.html#ad94d17b-8f0d-420e-b658-d4482.... In step 7 - add initial data, I added the data as per the tutorial though I observed that the "cds add data" command created ; separated fields. So, I changed my data like below.
my.bookshop-Authors.csv
ID;name
101;Emily Brontë
107;Charlote Brontë
150;Edgar Allen Poe
170;Richard Carpenter
my.bookshop-Books.csv where I changed the column separators as , instead of ;
ID,title,author_ID,stock
201,Wuthering Heights,101,12
207,Jane Eyre,107,11
251,The Raven,150,333
252,Eleonora,150,555
271,Catweazle,170,22
But as soon as I save those files, I get below errors in cds watch
[Error: ENTITY_ALREADY_EXISTS] {
errno: 19,
code: 400,
originalMessage: 'SQLITE_CONSTRAINT: UNIQUE constraint failed: my_bookshop_Authors.ID',
numericSeverity: 4
}
Please help. SAP Cloud Application Programming Model
Thanks,
Mainak
2024 Sep 25 12:16 AM
Are you able to please provide screenshots of your schema?
2024 Sep 25 6:36 AM
Hi Matt,
Sure, basically I just copied the same schema as copied from the same tutorial. I am pasting my schema.cds below.
2024 Sep 25 9:54 PM
2024 Sep 28 3:30 PM
Hi Thomas,
How to check in SQLITE3 if the data already exists? Otherwise how to clear/drop the tables?
Thanks,
Mainak
yesterday
Hi Mainak,
It seems in you entity key value are duplicating for AuthorID in Book entity.
Just changed the key value by adding some random number at end any try? it may work.
Thanks
yesterday