using foreach to do batch insert with mybatis

前端 未结 3 968
南方客
南方客 2021-01-03 15:16

I am using mybatis and i would like to insert an ArrayList to some table.
all right using foreach in mapper, well this ends up with oracle exception ORA_00933 .
t

3条回答
  •  伪装坚强ぢ
    2021-01-03 16:10

    Oracle does not support

    insert into xxx values (xxx,xxx),(xxx,xxx)

    maybe you can use insert all like this

        
        INSERT ALL
        
            INTO
            SYS_ROLES_PERMISSIONGROUP (role_id, permissiongroup_id)
            VALUES
            (#{model.role_id}, #{model.permissiongroup_id})
        
       
    

提交回复
热议问题