I couldn't see any mapper(mybatis-3-mapper.dtd) where I can call a merge statement in mybatis.
I saw tags for update, insert, delete and SQL
Anyone please suggest how to use oracle merge statement in Mybatis.
Call the merge as below:-
<update id="exceMerge" parameterType="hashmap">
MERGE INTO USERS U USING DUAL ON (U.PROPERTY_NAME=#{prop_name})
WHEN MATCHED THEN
UPDATE SET U.PROPERTYVALUE=#{prop_value}, U.MESSAGE=#{message,javaType=String,jdbcType=CLOB}
WHEN NOT MATCHED THEN
INSERT(PROPERTY_NAME, PROPERTYVALUE, MESSAGE) VALUES (#{prop_name},#{prop_value},#{message,javaType=String,jdbcType=CLOB})
</update>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With