You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/09/27 12:41:06 UTC

[GitHub] [incubator-shardingsphere] beiwangnull opened a new issue #3146: SQL grammar:batch insert into set not support?

beiwangnull opened a new issue #3146:  SQL grammar:batch insert into set not support?
URL: https://github.com/apache/incubator-shardingsphere/issues/3146
 
 
   ### Which version of ShardingSphere did you use?
   4.0.0-RC2
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-JDBC
   ### Expected behavior
   Using SQL grammar:batch insert into set
   ### Actual behavior
   return error
   ### Reason analyze (If you can)
   sharding does not support
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   ```
   mybatis:
   <sharding:inline-strategy id="orderTableStrategy" sharding-column="order_id" algorithm-expression="t_order$->{order_id % 2}" />
       <sharding:data-source id="shardingDataSource">
           <sharding:sharding-rule data-source-names="ds0">
               <sharding:table-rules>
                   <sharding:table-rule logic-table="t_order" actual-data-nodes="ds0.t_order$->{0..2}" table-strategy-ref="orderTableStrategy"/>
               </sharding:table-rules>
           </sharding:sharding-rule>
       </sharding:data-source>
   
   mapper:
           <insert id="batchAdd">
               <foreach collection="list" item="item" separator=";">
                     INSERT into user set `username`=#{item}
               </foreach>
           </insert>
   return error:
   
   ### Error updating database.  Cause: java.sql.SQLException: No value specified for parameter 2
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: INSERT into user set `username`=?          ;              INSERT into user set `username`=?          ;              INSERT into user set `username`=?
   ### Cause: java.sql.SQLException: No value specified for parameter 2
   ; bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 2] with root cause
    java.sql.SQLException: No value specified for parameter 2
   
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services