oracle mybatis批量insert

oralce 批量insert的语句格式:

insert into table_name (
 col_1,col_2)
 (
 select param,param1 from dual
 union all
 select param,param1 from dual
 )

xml文件中实现方式:


		INSERT INTO TABLE_NAME(
			
			ext_col,
			ext_col1,
			ext_col2,
			ext_col3,
			ext_col4
		) 
		(
		
			select 
			
			#{evaScore.extCol},
			#{evaScore.extCol1},
			#{evaScore.extCol2},
			#{evaScore.extCol3},
			#{evaScore.extCol4}
		 from dual
		
		)
	
	

注意:在oracle中不能以用下面的方式实现批量insert,否则会报语法错误

 insert into table_name(col_1,col_2) values(param,param1),(param,param1)

你可能感兴趣的:(mybatis)