Topic
  • 2 replies
  • Latest Post - ‏2013-02-18T14:24:44Z by JBrennan
JBrennan
JBrennan
77 Posts

Pinned topic Executing a dynamic SQL query with a < symbol

‏2013-02-14T14:59:29Z |
I am trying to run some dynamic queries generated from a xslt against a Oracle database. I can do this until I introduce a < sign in the query. I have the query externalized to a XML file right now and I get it via the document() function within my XSLT. I wrapped the query in CDATA in the XML and used the < escaped less than. All looks good. When I look in the probe, the query looks right with a < sign. Because DataPower wraps the query in XML, this becomes ivalid on the Oracle side. Oracle returns "ORA-00920: invalid relational operator". I cannot seem to get this escaped in the actual query that DP generates in the XML. If I hard code this query with the < sign in a static SQL action it works fine. Any ideas on how to introduce < in a dynamic query in XSLT? I tried disabling output escaping, wrapping the actual query in CDATA on the outbound side, etc. Any help is appreciated.
Updated on 2013-02-18T14:24:44Z at 2013-02-18T14:24:44Z by JBrennan
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: Executing a dynamic SQL query with a &lt; symbol

    ‏2013-02-18T06:54:06Z  
    Try using "<" instead of "<" (for e.g. ID < 444).
  • JBrennan
    JBrennan
    77 Posts

    Re: Executing a dynamic SQL query with a &lt; symbol

    ‏2013-02-18T14:24:44Z  
    Try using "<" instead of "<" (for e.g. ID < 444).
    Your post may have been converting escaped characters here. I see you suggesting to use < instead of < which is the same thig. If you had typed "ampersand lt semicolon" then I already tried that. DataPower, much like your post, converts that back to < when it writes the query to XML before it sends it out. That then becomes invalid XML again. I think if I can get DP to wirte the escape sequence instead of the < then I would be fine. I have not found any way of doing that.