Hello Oleg,

Thursday, August 09, 2001, 1:05:47 AM, you wrote:

ON> Hello Oleg,

ON> Can you turn the Castor log on and send the full SQL query that is generated?

Yes - result is here -

SELECT dm.cat_lang.cont_id,dm.cat_lang.lang_id,dm.cat_lang.cont_id,dm.cat_l
ang.cat_name,dm.cat_lang.cat_descr FROM dm.cat_lang,dm.cat dm.cat_0 WHERE dm.cat
_lang.cont_id=dm.cat_0.cont_id AND (not dm.cat_0.parent_id IS NOT NULL  and dm.c
at_lang.lang_id = ?)

result -

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/2] SQL0104N  An
unexpected token "." was found following "m.cat_lan 
g,dm.cat dm".  Expected tokens may include:  ",".  SQLSTATE=42601

I try to query database with generated SQL - result is same...

I think that error is in generated SQL - DB2 can not use table aliases
in FROM section with dot sign - 'dm.cat_0', for example...

ON> Oleg

ON> On Wednesday 08 August 2001 12:05, Oleg V Alexeev wrote:
>> Hello Low,
>>
>> Wednesday, August 08, 2001, 12:40:28 PM, you wrote:
>>
>> LHS> Have u try this
>>
>> LHS> select c from com.id.dm.dbeans.CategoryLang c where is_undefined(
>> LHS> c.boss.parent )
>>
>> Yes, of course. Castor parse it and pass to the DB2. And DB2 raise
>> error -
>>
>> COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/2] SQL0104N  An
>> unexpected token "." was found following "m.cat_lang,dm.cat dm".
>> Expected tokens may include:  ",".  SQLSTATE=42601
>>
>> LHS> -----Original Message-----
>> LHS> From: Oleg V Alexeev [mailto:[EMAIL PROTECTED]]
>> LHS> Sent: Wednesday, August 08, 2001 4:27
>> LHS> To: [EMAIL PROTECTED]
>> LHS> Subject: [castor-dev] Complex query
>>
>>
>> LHS> Hello castor-dev,
>>
>> LHS>   How can I write a query with complex predicate in WHERE section of
>> LHS>   OQL? For example - I try to query database with such OQL as -
>>
>> LHS>   select c from com.id.dm.dbeans.CategoryLang l where is_defined(
>> LHS>   c.boss.parent )
>>
>> LHS>   com.id.dm.dbeans.CategoryLang class has getBoss() method and section
>> LHS>   in mapping.xml -
>>
>> LHS>   <field name="boss" type="com.id.dm.dbeans.Category" require="true">
>> LHS>     <sql name="cont_id"/>
>> LHS>   </field>
>>
>> LHS>   com.id.dm.dbeans.Category has getParent() method.
>>
>> LHS>   How can I query such com.id.dm.dbeans.CategoryLang objects as for
>> LHS>   that objects getBoss().getParent() returns null?

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



-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]

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

Reply via email to