Skip to main content
Skip table of contents

Statement: Direct SQL

Input

HTML/XML
<any element name>
   <statement resulttag="result element name" timezone="timezone" format="Data format">
      <sql> SQL statement </sql>
   </statement> 
</any element name>

The following rules apply to each <statement/> element:

If you use characters within the SQL statement or for the values or data of the table columns that have a meaning in XML, mask the SQL statement with surrounding CDATA block, e.g. <![CDATA[ SELECT * FROM TABLE WHERE ID<1 ]]> or <rowset><row><name><!CDATA[ XML character “<“ in CDATA element]]></name></row></rowset>.

This ensures that the characters in the CDATA element are not interpreted as XML, but as data for the adapter.


Example
HTML/XML
<select>
   <statement resulttag="result" timezone="UTC" format="dd.MM.yyyy">
      <sql> <![CDATA[SELECT * FROM JMS_USERS]]> </sql>
   </statement> 
</select>

Output

If the SQL statement was executed successfully, the database connection element will output an XML document containing the query response as a string with the following structure:

HTML/XML
<Data>
   <result-element-name>
      <Field1><!--value--></Field1>
      <Fieldn><!--value--></Fieldn>
   </result-element-name>
</Data>


For SELECT statements used to access database tables with column names that do not represent a valid XML name, synthetic element names are created within the result XML document, in order to ensure that the XML document is well-formed. 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.