oracle jdbcTemplate 无效的列类型
oracle jdbcTemplate Invalid column type
我正在使用以下代码从数据库中删除一行
jdbcTemplateObject.update("DELETE FROM SUPERVISION_ROOM cl WHERE cl.fk_group IN ? and cl.fk_room IN ?", gourpIds, deleteExamDTO.getRoomIds());
但我收到以下异常:
PreparedStatementCallback; uncategorized SQLException for SQL [DELETE
FROM SUPERVISION_ROOM cl WHERE cl.fk_group IN ? and cl.fk_room IN ?];
SQL state [99999]; error code [17004]; Invalid column type; nested
exception is java.sql.SQLException: Invalid column type] with root
cause
JDBCTemplate 不支持 transparent IN 列表绑定,因为您尝试使用它。
记录在11.7.3. Passing in lists of values for IN clause
You would have to either have a number of variations with the desired number of place holders prepared or you would have to dynamically generate the SQL string once you know how many place holders are required.
所以基本上你必须首先 展开 SQL 语句并使用正确数量的 placeholders 然后将每个元素作为一个单独的参数。
...
WHERE cl.fk_group IN (?,?,?,?) and cl.fk_room IN (?,?)
我正在使用以下代码从数据库中删除一行
jdbcTemplateObject.update("DELETE FROM SUPERVISION_ROOM cl WHERE cl.fk_group IN ? and cl.fk_room IN ?", gourpIds, deleteExamDTO.getRoomIds());
但我收到以下异常:
PreparedStatementCallback; uncategorized SQLException for SQL [DELETE FROM SUPERVISION_ROOM cl WHERE cl.fk_group IN ? and cl.fk_room IN ?]; SQL state [99999]; error code [17004]; Invalid column type; nested exception is java.sql.SQLException: Invalid column type] with root cause
JDBCTemplate 不支持 transparent IN 列表绑定,因为您尝试使用它。
记录在11.7.3. Passing in lists of values for IN clause
You would have to either have a number of variations with the desired number of place holders prepared or you would have to dynamically generate the SQL string once you know how many place holders are required.
所以基本上你必须首先 展开 SQL 语句并使用正确数量的 placeholders 然后将每个元素作为一个单独的参数。
...
WHERE cl.fk_group IN (?,?,?,?) and cl.fk_room IN (?,?)