The INSERT into Select command for MyBatis does not end.

Source: Internet
Author: User

The INSERT into Select command on the MyBatis does not end, and it concludes that SQL was written incorrectly, but it is not a problem to execute in Plsql. Finally, the problem is solved,

is the setup problem.

# # # Cause:java.sql.sqlsyntaxerrorexception:ora-00933:sql command did not end correctly

The original configuration:

  <insert id= "Addhistorybypostbatchno" parametertype= "Parammap" >

Modified later, added a
Usegeneratedkeys= "false"

<insert id= "Addhistorybypostbatchno" parametertype= "Parammap" usegeneratedkeys= "false" >  insert   into Tb_dispatch_mail_history  (  mail_no, Rec_name, rec_address, Rec_telephone,   customer_no, Post_opter, Mail _content_name, Mail_weight,  actual_postage, Delivery_area, Post_time, Post_condition, Post_status, Post_      Batchno, customer_id   )   Select    mail_no, Rec_name, rec_address, Rec_telephone,    customer_no, Post_ Opter, Mail_content_name, Mail_weight,   actual_postage, Delivery_area, Post_time, post_condition,   post_ Status, Post_batchno, customer_id from   tb_dispatch_mail_post tp  <where>     tp.post_batchno=#{ Parammap.postbatchno}  </where>  </insert>  
Problem solved smoothly, not error. If you also encounter the same problem, please leave a message to discuss, I just solved the problem. If you see here you solve the problem, trouble to praise it!


The explanation of the official website is
Allows JDBC support to generate primary keys automatically, requiring driver compatibility. If set to true this setting forces the use of auto-generated primary keys, although some drivers are not compatible but still work (such as Derby).

The INSERT into Select command for MyBatis does not end.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.