1

I have a JPQL query which is giving me error as below and same query running fine when I used NativeSQLQuery, THe same JPQL code was running on JBoss 6 PERFECTLY WITH JAVAEE7 but did not work on PAYARA 5.192 with javaee8.

Exception Description: Syntax error parsing [SELECT weblook FROM WebLookup weblook WHERE weblook.lookupType=:looktype AND NVL(weblook.inactiveDate, SYSDATE + 1) > SYSDATE ORDER BY lookupDescription ]. The right expression is not a valid expression.

NativeSQL : SELECT * FROM MW_WEB_LOOKUP mwWebLookUp WHERE mwWebLookUp.LOOKUP_TYPE=:LOOKUPTYPE AND NVL(mwWebLookUp.INACTIVE_DATE , SYSDATE + 1) > SYSDATE ORDER BY mwWebLookUp.LOOKUP_DESCRIPTION

Amar
  • 565
  • 2
  • 8
  • 15

1 Answers1

0

SYSDATE is provider specific, e.g. not part of the JPA standard. Standard would be CURRENT_DATE, CURRENT_TIME or CURRENT_TIMESTAMP.

Here are some examples that you could try:

How do I query "older than three minutes" in JPA?

Christoph John
  • 3,003
  • 2
  • 13
  • 23