1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
+1 vote
857 views
by rich-c-2789 (17.6k points)
retagged by rich-c-2789
When I use a template with evaluateTemplate or a ODBC date literal with doQuery the function bodies and date literals are stripped out.  How can I embed curly braces with content without it being stripped out of the result?

3 Answers

+1 vote
 
Best answer
Javascript Function Block Example:
var template = "<script>\n" +
" function updateSettings() {\n" +
"   alert('test');\n" + 
" }\n" +
"</script>";
 
qie.evaluateTemplate(template, parameters);
 
Bad Result:
<script>
function updateSettings()
</script>
 
Solution - Use numeric character references:
var template = "<script>\n" +
" function updateSettings() &#123;\n" +
" alert('test');\n" + 
" &#125;\n" +
"</script>";
 
qie.evaluateTemplate(template, parameters);
 
Good Result:
<script>
function updateSettings() {
  alert('test');
}  
</script>
by rich-c-2789 (17.6k points)
selected by michael-h-5027
+1 vote
SQL ODBC Date Literal Example:
qie.doQuery(dbName, "select * from person where birth = {d '2000-09-09'}");
 
Bad Result:
select * from person where birth =
 
Solution - Use numeric character references:
qie.doQuery(dbName, "select * from person where birth = &#123;d '2000-09-09'&#125;");
 
Good Result:
select * from person where birth = {d '2000-09-09'}
 
Alternatively use other supported date or date literal syntax as per database vendor.  See these Date Literal references:
by rich-c-2789 (17.6k points)
0 votes
by rich-c-2789 (17.6k points)
...