Recently, I used Mybatis to add oracle databases in batches. The methods I found online at the beginning were to update mySQL. I tried it and found it was not suitable for Oracle, later, we found that the correct SQL statement added in batch in oracle is: insertidinsertAttractionsBatchparameterTypejava. util. listinsertintoATTRACTIONS (ID, N
Recently, I used Mybatis to add oracle databases in batches. The methods I found online at the beginning were to update mySQL. I tried it and found it was not suitable for Oracle, later, we found that the correct SQL statement added in batch in oracle is: insert id = insertAttractionsBatch parameterType = java. util. list insert into ATTRACTIONS (ID, N
Recently, I used Mybatis to add oracle databases in batches. The methods I found online at the beginning were to update mySQL. I tried it and found it was not suitable for Oracle, later, we found that the correct SQL statements added in batch in oracle are:
Insert into ATTRACTIONS (
ID, NAME, longpolling, LATITUDE, UPDATE_TIME
)
(Select
# {Item. id, jdbcType = VARCHAR}, # {item. name, jdbcType = VARCHAR}, # {item. longpolling, jdbcType = DECIMAL}, # {item. updateTime, jdbcType = TIMESTAMP}
From dual)
New:
Insert into ATTRACTIONS (
ID, NAME, longpolling, LATITUDE, UPDATE_TIME
)
# {Item. id, jdbcType = VARCHAR}, # {item. name, jdbcType = VARCHAR}, # {item. longpolling, jdbcType = DECIMAL}, # {item. updateTime, jdbcType = TIMESTAMP}
Oracle update cannot be implemented in the normal way. You need:
Begin
Update ATTRACTIONS
Id = # {item. id },
HEAD = # {item. head },
Where id = # {item. id}
; End;
The deletion is the same as MySql:
Delete from ATTRACTIONS
Id = # {item. id}