Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Pras Tiwari
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • 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
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!