This in response to messages posted by

            Kevin Lanaghan

            Mutchler Scott

And      Low Heng Sin

 

I’m new to castor, have been working with it for about 5 days now. I’ve stumbled across the same problem as Mutchler Scott, i.e. trying to compare a timestamp field in a database to the current data, or just any date. Problem is that, as stated by Mutchler Scott, that one would like to only compare the date, and not the time. Recommendation by Low was to use the trunc() function as follows: select p from MyObject p where trunc(modifiedDate) = $1

 

I’ve tried this, and get the same error as Mutchler Scott, as posted on the 7th June 2002:

 
org.exolab.castor.jdo.QueryException: The field trunc was not found.
        at org.exolab.castor.jdo.oql.ParseTreeWalker.checkField(ParseTreeWalker.java:595)
        at org.exolab.castor.jdo.oql.ParseTreeWalker.getTypeForComparison(ParseTreeWalker.java:670)
        at org.exolab.castor.jdo.oql.ParseTreeWalker.checkParameter(ParseTreeWalker.java:645)
        at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause(ParseTreeWalker.java:532)
        at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause(ParseTreeWalker.java:540)
        at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause(ParseTreeWalker.java:540)
        at org.exolab.castor.jdo.oql.ParseTreeWalker.checkErrors(ParseTreeWalker……
 
My questions to this subject are as follows:
1.       is the trunc() function Oracle specific?
2.       if not, is this a problem with castor v 0.9.3.9, which I’m also currently using,
3.       or are both me and Mutchler Scott making the same mistake. If so, please could someone post a detailed example of how to use the trunc() method.
 
Thanx

 

Erich Lauterbach

skynamics AG

www.skynamics.com

 

Reply via email to