Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Quotes behavior when loading CDATA[] from XML

I'm not sure what to make of this.  I'm loading a sql string from an xml file and then doing a Qlikview replace on that sql.  Here is the simplified xml:

<item>

        <sql><![CDATA[select 'text' from table]]></sql>

        <filename>filename.txt</filename>

  </item>

Here's my test script:

XML:

LOAD trim(sql) as sql_string,

    replace(filename, '.txt', '') as filename

FROM test.xml (XmlSimple, Table is [dbCallList/item]);

sql_string:

LOAD sql_string as sql resident XML where filename = 'filename';

let vSQL = peek('sql');

trace $(vSQL);

// replace nothing with nothing

let vSQL = replace('$(vSQL)', '', '');

trace $(vSQL);

The output before the replace is:

select 'text' from table

The output after the replace (which should do nothing):

select ''text'' from table

It adds two single quotes on either side of the string, which make it invalid SQL.  Is this weird?  Or am i missing something?

Thanks

1 Reply
Not applicable
Author

Any thoughts on this?  I submitted it just before the weekend maintenance so it might have gotten lost.