函数RTRIM / LTRIM用错误的数字或类型的参数调用

时间:2018-07-26 03:51:49

标签: hibernate sybase hibernate-mapping

TEXT数据类型Sybase数据库表列上的HQL中的RTRIM / LTRIM错误。我还尝试了删除sql-type="text"

请在下面找到我的编码详细信息:

<hibernate-mapping>
  <property name="prop1" type="text">
            <column name="col1" sql-type="text"/>
  </property>
</hibernate-mapping>

HQL:

String queryTest= "SELECT * FROM TestTb WHERE id="+Long.parseLong(rowID) + " and (prop1 is not null) and (ltrim(prop1) <> '') and (rtrim(prop1) <> '') ";

查询执行错误:

WARN  (org.hibernate.util.JDBCExceptionReporter)  - SQL Error: 11021, SQLState: ZZZZZ
ERROR (org.hibernate.util.JDBCExceptionReporter)  - Function LTRIM invoked with wrong number or type of argument(s).
ERROR (org.hibernate.util.JDBCExceptionReporter:101)  - Function LTRIM invoked with wrong number or type of argument(s).
WARN  (org.hibernate.util.JDBCExceptionReporter)  - SQL Error: 11021, SQLState: ZZZZZ
ERROR (org.hibernate.util.JDBCExceptionReporter)  - Function RTRIM invoked with wrong number or type of argument(s).

0 个答案:

没有答案