Skip to main content
Skip table of contents

StatementBatch: Direktes SQL im Batch-Modus

Input

In batch mode, the JDBC Connector executes multiple SQL statements at the same time, if they are deposited in the following input XML structure. In this case, only SQL statements are possible, which do not return a ResultSet, i.e. no queries with SELECT:

HTML/XML
<any element name>
   <statementbatch resulttag="result element name" timezone="timezone"
    format="Date format">
      <sql> SQL statement 1</sql>
      <sql> SQL statement n</sql>
   </statementbatch> 
</any element name>

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

  • The optional attribute timezone specifies a time zone according to java.util.TimeZone, e. g. GMT+2, see http://docs.oracle.com/javase/1.5.0/docs/api/java/util/TimeZone.html.

  • The optional attribute format specifies a date format according to java.text.SimpleDateFormat.

  • It contains at least one <sql/> element that each contains an SQL statement.

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[ UPDATE PROCESS SET X4_VERSION=4 WHERE X4_DURATION=100 ]]> 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>
   <statementbatch resulttag="result-element-name" timezone="UTC" format="dd.MM.yyyy">
      <sql>  
         <![UPDATE PROCESS SET X4_VERSION=4 WHERE X4_DURATION=100]]>
      </sql>
      <sql>  
         <![UPDATE PROCESS SET X4_VERSION=4 WHERE X4_DURATION=200]]>
      </sql>
   </statementbatch> 
</select>

Output

If the batch statement was executed successfully, the database connection element will output the following structure:

HTML/XML
<Data>
   <result-element-name>
      <!--status of the batch operation-->
   </result-element-name>
</Data>

The following status outputs are possible for the Batch operation:

  • (number of rows) rows affected. or

  • SUCCESS_NO_INFO oder

  • EXECUTE_FAILED

JavaScript errors detected

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

If this problem persists, please contact our support.