Hi,
Please see the following query. When I execute this from Code it gives me
SEVERE: *** ERROR: line 1:491: unexpected token: (
May 3, 2007 11:06:59 AM org.hibernate.hql.ast.ErrorCounter reportError
SEVERE: *** ERROR: line 1:562: unexpected token: (
May 3, 2007 11:06:59 AM org.hibernate.hql.ast.ErrorCounter reportError
SEVERE: *** ERROR: line 1:588: unexpected token: max
May 3, 2007 11:06:59 AM org.hibernate.hql.ast.ErrorCounter reportError
SEVERE: *** ERROR: line 1:609: unexpected token: AS
Although this query works perfectly in DB2. Please Note Brackets and syntax is perfectly correct as it works in database.
Its urgent kindly look into the matter.
-------------------------- Query -----------------------------------------
+ "SELECT DISTINCT t1.tfzRequestId"
+ " FROM"
+ " FzRequestAllowanceViewDE AS t1,"
+ " ("
+ " SELECT A.tfzDecisionId"
+ " FROM FzDecisionDE A,"
+ " ("
+ " SELECT B.tfzRequestId , max (B.decisionDate) AS MAXDECISIONDATE FROM FzDecisionDE B"
+ " WHERE B.bisFinalized = 'T'"
+ " AND B.decisionDate <= '2008-12-31 00:00:00.000000'"
+ " GROUP BY B.tfzRequestId" + " ) AS x"
+ " WHERE A.tfzRequestId = x.tfzRequestId"
//+ " AND A.decisionDate = X.MAXDECISIONDATE"
+ " AND A.bisFinalized = 'T'"
+ " GROUP BY A.tfzRequestId, A.tfzDecisionId" + " ) AS t2");
---------------------------------------------------------------------------
Thanks
Dhiraj
|