Error:
mybatis plus foreach batch insert is OK. Change it to update and keep reporting errors. It is OK to copy the SQL and execute it separately.
reason:
the insert statement supports batch and can be written in one statement:
INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...), (value1,value2,value3,...), (value1,value2,value3,...), (value1,value2,value3,...), (value1,value2,value3,...),(value1,value2,value3,...);
Update does not support batch. There are multiple statements corresponding to cyclic batch
update table set c1=v1;
update table set c1=v2;
update table set c1=v3;
.
.
.
update table set c1=v...;
Mybatis does not support executing multiple statements (multiple semicolons) by default
solution:
add the allowmultiqueries = true parameter to the database connection
Allowmultiqueries = true function:
1. You can carry semicolons after SQL statements to realize multi statement execution
2. You can execute batch processing and issue multiple SQL statements at the same time
Read More:
- [Solved] java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corres
- MySQL Change password failure prompt: ERROR 1064(42000):You have an error in your SQL syntax: check the corresponds to your M
- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
- [Solved] pymysql.err.ProgrammingError: (1064, ‘You have an error in your SQL syntax;
- Mysql 8.0.13 Enabling remote access (ERROR 1064 (42000): You have an error in your SQL syntax; check the manual th)
- MYSQL Use cmd to change root password error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha
- MySQL Build table error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser
- Error 1064 (42000): you have an error in your SQL syntax
- [Solved Perfectly] MySQL ERROR 1064 (42000): You have an error in your SQL syntax;
- java.sql.SQLException: Disk full (/tmp/#sql_1eaa2_60.MAI); waiting for someone to free some space
- Cause: java.sql.SQLException: ORA-01407: Unable to update (“MESIRJ”.”TMMIC01″.”RDEL”) is NULL
- MYSQL Safe Upgraded Error: You are using safe update mode and you tried to update
- [Linux Docker Mirror] MYSQL Run sql Script Error: Failed to open file ‘/home/mydatabase.sql‘, error: 2
- [Modified] Hive SQL Error: SQL ERROR [10004] [42000]: Error while compiling statement: FAILED: SemanticException [Error
- Introduction to Relational Databases in SQL
- Can mybatis prevent SQL injection
- [Solved] SQL Error: Method queryTotal execution error of sql
- Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 – Connection is not available, request timed out after 30005ms.
- Dbeaver connects hive to solve the problem that hive custom UDF functions cannot be used in SQL queries in dbeaver
- SQL editor and reconnect [an exception when MySQL (workbench) updates data] [error code: 1175]