Hello, I have a sql-query in hbm file as
Code:
select count(REQUESTID) AS TOTALREQUESTS
, TO_CHAR(ENTRYDATE, :DFPARAM1) AS ENTRY_DATE FROM
REQUEST_TABLE WHERE
ENTRYDATE BETWEEN TO_DATE(:FROM_DATE, 'DD.MM.YYYY')
AND TO_DATE(:END_DATE, 'DD.MM.YYYY')
GROUP BY TO_CHAR(ENTRYDATE, :DFPARAM1)
Now if you will see the param :DFPARAM1 is used twice, once in select column and another in group by.
Now if i set the param values quer.setString("DFPARAM1","'mm/dd/yyyy'") along with setting all the other params, in hibernate i get this not a group by expression error. the query runs fine from sqlplus.
Please note that with debug on, i see the query converted as ? in place of named parameters.
Any help will be greatly appreciated.