I am trying to sort the output of select statement based on the substring value in the column 'name'. Here’s my HQL query.
2012-08-08 18:08:14,453 DEBUG - [org.hibernate.hql.internal.ast.QueryTranslatorImpl] :HQL: from com.emc.mnsvc.component.tag.Tag order by substring(name,0,position('X' in name))
After conversion SQL has no parameters in position()
2012-08-08 18:08:14,453 DEBUG - [org.hibernate.hql.internal.ast.QueryTranslatorImpl] :SQL: select tag0_.id as id24_, tag0_.description as descript2_24_, tag0_.name as name24_, tag0_.readOnly as readOnly24_ from mnsvc.Tag tag0_ order by substring(tag0_.name, 0, position())
This causes the SQL execution to fail.
Expected output if command were to work: psql -d mnsvcDB -c "select * from tag order by substring(name,0,position('X' in name));"
id | name | readonly | description ----+----------------+----------+------------- 1 | VNX_domain_101 | t | (1 row)
I can provide a full trace if that helps. Wanted to quickly check if this is a known issue and if is workaround.
Thanks, Juzar.
|