Hello,

I'm always on my comparison of the month of the birthdate and a value
(like, <, >, = ...).
Now it's ok while using like operator, but not while using >= ...



SELECT assure FROM fr.cnam.scapin.metier.donnees.assures.Assure assure
where to_number(to_char(assure.dateNaissance,"MM"),"90") >= $1
0 [main] ERROR exception.ApplicationException  - 
--------------- DEBUT ERREUR -------------------------
16 [main] ERROR exception.ApplicationException  - Message =
error.requetesJdo.erreur<org.exolab.castor.jdo.QueryException: The field
to_number was not found.> - nestedException =
org.exolab.castor.jdo.QueryException: The field to_number was not found.
org.exolab.castor.jdo.QueryException: The field to_number was not found.
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.checkField(ParseTreeWalker.jav
a:645)
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.getTypeForComparison(ParseTree
Walker.java:720)
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.checkParameter(ParseTreeWalker
.java:695)
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause(ParseTreeWalk
er.java:582)
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause(ParseTreeWalk
er.java:590)
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause(ParseTreeWalk
er.java:590)
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.checkErrors(ParseTreeWalker.ja
va:236)
        at
org.exolab.castor.jdo.oql.ParseTreeWalker.<init>(ParseTreeWalker.java:13
7)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl.create(OQLQueryImpl.java:275)
        at
org.exolab.castor.jdo.engine.DatabaseImpl.getOQLQuery(DatabaseImpl.java:
467)



And this is ok (even if it's more logic to write "where
to_char(assure.dateNaissance,"MM") like $1" ):

SELECT assure FROM fr.cnam.scapin.metier.donnees.assures.Assure assure
where to_number(to_char(assure.dateNaissance,"MM"),"90") like $1

[testCastor] SELECT
"ASSURE"."IDASSURE","ASSURE"."NUMNATIDENT","ASSURE"."CLENUMNATIDENT","AS
SURE"."REGIMEPRINCIPAL","ASSURE"."CIVILITE","ASSURE"."NOMPATRONYMIQUE","
ASSURE"."PRENOM","ASSURE"."NOMMARITAL","ASSURE"."IDENTIFIANTASSURE","ASS
URE"."DATE1EREIMMAT","ASSURE"."DATEDECES","ASSURE"."DATEDECESCONJOINT","
ASSURE"."DATEMARIAGE","ASSURE"."DATENAISSANCE","ASSURE"."TELEPHONE","ASS
URE"."NUMRUE","ASSURE"."ADRESSE","ASSURE"."COMPADRESSE","ASSURE"."CODEPO
STAL","ASSURE"."VILLE","ASSURE"."DEPARTEMENT","ASSURE"."PAYS","DEMANDE".
"IDDEMANDE" FROM "DEMANDE","ASSURE" WHERE
"ASSURE"."IDASSURE"="DEMANDE"."IDASSURE"(+) AND
(to_number(to_char("ASSURE"."DATENAISSANCE" , 'MM'  )  , '90'  )  like
?)

[testCastor] Castor: Loading
fr.cnam.scapin.metier.donnees.assures.Assure (17)


Is this a pb of the syntaxic processor of Castor which does'nt allow a
function in front of <= operators ?

What do you think about this ?

Sylvie
___________________
CREDI RA
Sylvie Palluel

[EMAIL PROTECTED]
___________________





**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to