Ibatis ORA-00936: 缺失表达式 异常原因之一

阅读更多

用ibatis2.0做持久层开发,出现以下异常:

com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred while applying a parameter map.  
--- Check the FINGERDB_MANAGERINFO.countByParams-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: ORA-00936: 缺失表达式

Caused by: java.sql.SQLException: ORA-00936: 缺失表达式

	at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
	at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:565)
	at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:540)
	at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
	at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:84)
	at data.ManagerInfoDao.countByParams(ManagerInfoDao.java:33)

 经排查,错误在此处:


  	 			
  	 				DEPTNO = #deptnos[]#
  	 			
  	 		

 去掉

prepend="AND"

 改成以下即可。


  	 			
  	 				DEPTNO = #deptnos[]#
  	 			
  	 		

 

你可能感兴趣的:(Ibatis ORA-00936: 缺失表达式 异常原因之一)