strongduanmu opened a new issue #2390: shading-jdbc does not support multiline 
sql execution
URL: https://github.com/apache/incubator-shardingsphere/issues/2390
 
 
   In my scenario, I need to update some data in a batch, which was previously 
able to execute multi-line sql statements at a time by mybatis foreach 
statements, but now that shading-jdbc is not supported, I hope to add this 
feature(I'm so sorry for my pool english).
   
   Code is like this:
   ```xml
   <update id="updateDataBatch">
       <foreach collection="updateVos" item="updateVo">
           UPDATE tb_price_shard
           SET price = #{updateVo.price}
           WHERE id = #{updateVo.id};
       </foreach>
   </update>
   ```
   And error is like this:
   ```
   org.springframework.jdbc.BadSqlGrammarException: 
   ### Error updating database.  Cause: 
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in 
your SQL syntax; check the manual that corresponds to your MySQL server version 
for the right syntax to use near 'UPDATE tb_price_shard
   ```
   It can not parse sql and route to correct shard table.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to