oracle批量insert into问题

mysql一次insert多条写法:

insert into oa_send (id, docid, sendid, sendname, nodetype, type) VALUES 
( '2b69823f1d964e049ca4b96832212d4b', '0b6c52740aae47189fa61afe9c60ca7d', '1f3c92ca-0cc5-4954-842a-933c0acf482d#4', '赵'
, '', 'leaderSend' ),
( '1b69823f1d964e049ca4b96832212d4b', '0b6c52740aae47189fa61afe9c60ca7d', '1f3c92ca-0cc5-4954-842a-933c0acf482d#4', '赵'
, '', 'leaderSend' );

在Oracle中不能使用values(),()这样的写法


解决办法:

在mybatis中批量添加


		insert all
		
			into oa_send
			(id,
			docid,
			sendid,
			sendname,
			nodetype,
			type)
			VALUES
			(
				#{item.id,jdbcType=VARCHAR},
				#{item.docid,jdbcType=VARCHAR},
				#{item.sendid,jdbcType=VARCHAR},
				#{item.sendname,jdbcType=VARCHAR},
				#{item.nodetype,jdbcType=VARCHAR},
				#{item.type,jdbcType=VARCHAR}
			)
		
		select 1 from dual
	

你可能感兴趣的:(oracle)