This is the WSO2 Data Services Server documentation version 2.6.3

Query Result Export Demo

The operations "thousandFive" and "incrementEmployeeSalaryEx" are used in demonstrating the query result export functionality in a data service. The query used in "thousandFive" operation exports the a result value with the name "increment". This increment value is taken in as a parameter by the query in the "incrementEmployeeSalaryEx" operation.

The figure below shows the dbs fragment that defines this behavior:

<query id="thousandFiveQuery" useConfig="default">
	<sql>select 1500 as value</sql>
	<result element="Numbers" rowName="Number">
		<element name="value" column="value" export="increment" xsdType="xs:integer" />
	</result>
</query>
<query id="incrementEmployeeSalaryQuery" useConfig="default">
	<sql>update Employees set salary=salary+? where employeeNumber=?</sql>
	<properties>
		<property name="org.wso2.ws.dataservice.autocommit">true</property>
	</properties>
	<param name="increment" sqlType="DOUBLE" original="1" />
	<param name="employeeNumer" sqlType="INTEGER" ordinal="2" />
</query>
  • employeeByNumber(1002)
  • begin_boxcar()
  • thousandFive()
  • incrementEmployeeSalaryEx(1002)
  • end_boxcar()
  • employeeByNumber(1002)

The return values from the first "employeeByNumber()" call and the second have a difference of 1500, which is the amount incremented within the boxcarring session. The 1500 value is passed into "incrementEmployeeSalaryEx" operation by the "thousandFive" operation.