cancel
Showing results for 
Search instead for 
Did you mean: 

Initial data support for text fields containing newlines

hschaefer123
Participant
335

I am referring to URL:

https://cap.cloud.sap/docs/guides/databases?q=data+csv#providing-initial-data

Please get back to me on the following feedback:

For performance reasons, I am trying to import formerly exported/converted sqlite3 mock data
(generated from xml inside init.js)
to `data/TABLE.csv`. using plain tools

cds deploy srv --to sqlite:bme.db --no-savesqlite3 -header -csv bme.db \"select * from ns_Product;\" > ns-Product.csv

The current showstopper is the missing support for text properties containing newlines, because the `cds-deploy.js` can not handle it and throws an error.

But the official text/csv spec seems to support it
https://www.rfc-editor.org/rfc/rfc4180

escaped = DQUOTE *(TEXTDATA / COMMA / CR / LF / 2DQUOTE) DQUOTE

And this is also the way, sqlite3 exports the CSV from an existing table.

Is there maybe another way off adding text with newlines to initial mock data using CSV files (special escape sequence, etc)?

If there is no other way to handle it, any change to get support for this feature request?
I think, it would be a benefit, if CAP would could support this for initial data out-of-the-box.

Right know, i played some hours with workarounds, but none really fits my needs ;-(

Best Regards
Holger

chgeo
Advisor
Advisor
0 Kudos

Hi..

yes, totally makes sense, but looks like a gap. I don't think there is an escape sequence like \n available atm.

SAP HANA's hdbtabledata seems to support \n escaping according to their documentation as well, so looks good. Will keep you posted.

Regards
Christian

chgeo
Advisor
Advisor
0 Kudos

Also see the discussion on https://answers.sap.com/questions/13738545/

hschaefer123
Participant
0 Kudos

Hi Christian,

thanks for the feedback.

I know, all of you are quite busy with TechEd.

Regards Holger

Accepted Solutions (0)

Answers (0)