Query to CSV string - how to escape double quotes
Hi,
I have some code that runs as part of an app engine which outputs a Query to a comma-separated string:
&strCSV = %This.apiQuery.RunToString(&recPromptRecord, 0, %Query_TXT, - 1);
All of the columns returned are enclosed in double-quotes (regardless of whether the value contains a comma or not, but this isn't an issue). However, when the value extracted contains a double quote itself, the downstream system processing this file complains as these double quotes are not escaped. So for example if we were extracting departments you might get:
SETID, DEPTID, DESCR
"AAA01","BBB01", "This is fine"
"AAA02","BBB02","This "breaks" my downstream interface"