sqlExec issue
Hello,
My goal is to extract the entire xml-code of a workflow (in a javascript-action), make changes to it (in this case I want to remove any example data in file import-actions that might violate GDPR) and store the new xml in the database.
I extract the xml using
var wf = NLWS.xtkWorkflow.get(id);
var str = wf.toDocument().toXMLString()
and try to write it back again using
result = sqlExec("update xtkWorkflow set mData = '" + tempChunk + "' || mData where sInternalName = '" + internalName + "'");
Problem is, I guess, if the string "tempChunk" contains the combination "$(" as in "$(vars/@tableName)" the sqlExec-function believes I'm trying to use one of these function specific substition parameters:
- $(sz) string
- $(m) memo
- $(l) long
- $(s) short
- $(b) byte
- $(d) double
- $(f) float
- $(ts) timestamp
- $(dt) date
- $(tm) time
- $(dur) timespan en millisecondes (ms)
and fails with an error message like this one:
2018-05-30 14:14:54 js2 Type 'vars/@tableName' is not a valid type of parameter.
So, my question is, is there any way around this?