I am trying to run a Hibernate Query to multiply and sum two values grouped by another values, I constantly keep getting SQLState = Null Invalid column Name errors...
select poee.descrip,
sum(qi.volume),
sum(qi.volume * qi.avgCost)
from trans as q
joins... here...
where d.termType = :termType..
and "some date range "...
group by and order by are there...
etc...
This is how I executed this query it runs first for the first date range, for the second date range I get the error given below. Then I assumed it has something to do with null value when trying to multiply null and a non-null value, and I substitued with oracle "nvl" as given below;
I tried first like this;
sum(nvl(qi.volume, 0.00) * nvl(qi.avgCost, 0.00)) and also this,
sum(nvl(qi.volume, doubleVal) * nvl(qi.avgCost, doubleVal))
both are not working, CAN SOMEONE PLEASE HELP ME!. I need to finish this ASAP.
0:00:00 EDT 2005
18 Jul 17:04 DEBUG BaseReport - Here 2.
18 Jul 17:04 WARN JDBCExceptionReporter - SQL Error: 17006, SQLState: null
18 Jul 17:04 ERROR JDBCExceptionReporter - Invalid column name
18 Jul 17:04 WARN JDBCExceptionReporter - SQL Error: 17006, SQLState: null
18 Jul 17:04 ERROR JDBCExceptionReporter - Invalid column name
18 Jul 17:04 ERROR JDBCExceptionReporter - Could not execute query
java.sql.SQLException: Invalid column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:292)
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp