• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

please help me about EJB-QL......

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am developing small application using EJB CMP2.0. I am using EJB-QL finder methods in my brean to access perticular record in database.
Please anybody tell me the equivalent EJB-QL finder statement of following SQL statement in RDBMS.
My SQK Statement is:-
======
"select cm.cartid from cartmaster cm where cm.customerid ='C00000121' and cm.status ='active' and cm.cartdate > CURRENT_TIMESTAMP(0)-interval '48 hours'"
==========

This sql statement in working fine RDBMS Query tool against my table. But I cant find the corresponding matching term for the term "CURRENT_TIMESTAMP(0)-interval '48 hours'" used in above sql query. Can anybody please tell me what is Equivalent of above timestamp term in my SQL query? I m trying it since last 2 days but till now not succeeded. PLease help me regarding this.
Thanx in advance.
Prash
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to understand EJB QL is not a complete SQL so the functions used for a specific DB is not guaranteed to be supported in EJB QL. Do write a view and do the select from that view. This way you can have the required function.
reply
    Bookmark Topic Watch Topic
  • New Topic