cancel
Showing results for 
Search instead for 
Did you mean: 

CAP: incorrect DB insert of boolean values in string fields from CSV

alicegavanelli
Participant
475

Dear Experts,

I have an entity with a string field called "defaultValue".

entity PropertiesTest : cuid { 
    defaultValue : String(1000); 
}

If in this field I put string "true" or "false", the value is interpreted as boolean and is converted to "1" and "0".

Data are inserted by csv file. I have tried also with quotation marks.

ID;defaultValue
bc1c3c82-6ade-11eb-9439-0242ac130002;true
773a6a34-6adf-11eb-9439-0242ac130002;false
7b96940e-6adf-11eb-9439-0242ac130002;alice test
7b96940e-6adf-11eb-9439-0242ac130005;'false'
7b96940e-6adf-11eb-9439-0242ac130006;"false" 

If I try by OData, the string is correctly inserted.

HTTP/1.1 200 OK
{
  "d": {
    "ID": "773a6a34-6adf-11eb-9439-0242ac130002",
    "defaultValue": "false",
    "__metadata": {
      "type": "WTest.PropertiesTest",
    }
  }
}

We have solved using a workaround but maybe it should be fixed.

Best.

gregorw
Active Contributor
0 Kudos

Please file that also as an Issue via the SAP Service Marketplace.

alicegavanelli
Participant
0 Kudos

Thank you Gregor,

I've opened the incidente:

161611 / 2021 CAP: incorrect DB insert of boolean values in string fields from CSV

Best

Alice

chgeo
Advisor
Advisor

Thanks for reporting. We will track progress in the incident now. Please understand that we cannot keep this community issue up to date as well.

gregorw
Active Contributor

So Alice please give us an update when you've got a solution from SAP.

alicegavanelli
Participant
0 Kudos

SAP hasn't given me any answer yet.

gregorw
Active Contributor
0 Kudos

Any updates?

alicegavanelli
Participant
0 Kudos

Unfortunately not yet.

The incident is still in "In process by SAP".

I had asked for a feed-back in April but no one answered me.

It will certainly be my care to update you as soon as SAP will answer me.

gregorw
Active Contributor
0 Kudos

I would suggest to reach out to the SAP Support Hotline and ask for a speedup.

gregorw
Active Contributor

I've now also filed an issue: 757245 / 2021

alicegavanelli
Participant
0 Kudos

Has SAP answered to you?

gregorw
Active Contributor
0 Kudos

No. Status "in processing" and that since 17th November 2021.

Accepted Solutions (0)

Answers (1)

Answers (1)

steffenwaldmann
Product and Topic Expert
Product and Topic Expert

Hi Alice,

Good news, we shipped a fix for this issue in the most recent @sap/cds release (5.9.0). The SQLite CSV importer will now interpret quoted "true" and "false" as strings instead of Booleans.

Best regards,

Steffen