Hi all, just a query regarding updating multiple tables in ibatis. For our project we want to be able to keep transparency between the dao code and the actual sql statements. Different records get updated depending on the business unit involved.
Essentially, we want to be able to call one statement that will update multiple tables in the database. Is there any way of doing this in iBatis? The only ways I can thin of is putting all the update statements within one statement but that doesn't work.
<!-- Updates the status information about a request in the database -->
<update id = "updateRequestStatusData" parameterClass = "RequestStatusVO">
UPDATE ktnasnd.kcrt_request_details
SET
parameter40 = #projectNumber:VARCHAR#
WHERE
request_id = #requestId# and batch_number = 1;
UPDATE ktnasnd.kcrt_request_details
SET
parameter17 = #status:VARCHAR#
WHERE
request_id = #requestId# and batch_number = 4;
UPDATE ktnasnd.kcrt_request_details
SET
parameter50 = #errorMessage:VARCHAR#
WHERE
request_id = #requestId# and batch_number = 5;
</update>
Is there a way to call a statement that then calls multiple statements.


Reply With Quote