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).