ORA-01795: maximum number of expressions in list is 1000

When I checked the log today, I found that the following exceptions occurred many times. After consulting the data, I found that INthe maximum number of expressions written in the statement cannot exceed 1000.

Solutions: 1. Split INthe conditions inside, control the number of expressions within 1000, and then ORconnect them through statements.

                2. As a subquery.

I used the second method:

<if test="createBy != null and createBy.name != null and createBy.name != ''">
	AND a.create_by in (select u.id as "createBy.id" FROM sys_user u where u.name LIKE
		<if test="dbName == 'oracle'">'%'||#{createBy.name}||'%'</if>
		<if test="dbName == 'mssql'">'%'+#{createBy.name}+'%'</if>
		<if test="dbName == 'mysql'">concat('%',#{createBy.name},'%')</if>
	)
</if>

  

The first method has time to try again

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324900565&siteId=291194637