I'm sorry but I can't see how the problem you describe is related to my question. My Question was whether outer joins are supported or not and if not, what the work-around could be.


Regards,


Tarlika Elisabeth Schmitz



Saravana Kannan wrote:
Hi,

Note: The mail may seem unrelated if you dont read till the last line.


-----Original Message----- From: T E Schmitz <[EMAIL PROTECTED]> To: Apache Torque Users List <[EMAIL PROTECTED]> Date: Sun, 02 May 2004 17:43:21 +0100 Subject: left outer join

Hello,

I have 3 tables SECTION and BRAND and MODEL. SECTION is related to BRAND and to MODEL via two foreign keys. I would like to select ALL SECTIONs whether the FKs are null or not and fetch the BRAND and MODEL attributes in one SQL statement. In other words I need a double outer join:

SELECT
SECTION.SECTION_PK,
SECTION.SECTION_NAME,
SECTION.BRAND_FK,
SECTION.MODEL_FK,
BRAND.BRAND_NAME
MODEL.MODEL_NAME
FROM SECTION
left outer join MODEL  on MODEL_PK =MODEL_FK
left outer join BRAND  on BRAND_PK =BRAND_FK

I have seen some old discussion threads from 2002 suggesting that Torque does not support outer joins. Is this still the case?

If so, can anyone suggest an efficient work-around? I'd rather not fetch the other table's attributes in a loop.

=======================================================================
2nd Problem
-----------
Scenario as above but this time SECTION has two foreign key relationships with the same table:


SELECT
SECTION.SECTION_PK,
SECTION.SECTION_NAME,
SECTION.BRAND_1_SKIPPED_FK,
SECTION.BRAND_2_SKIPPED_FK,
BRAND.BRAND_NAME (1)
BRAND.BRAND_NAME (2)
FROM SECTION
left outer join BRAND  on BRAND_PK =BRAND_1_SKIPPED_FK
left outer join BRAND  on BRAND_PK =BRAND_2_SKIPPED_FK

(the above obviously doens't work as SQL statement but ...)

How would I specify the same output columns twice?
How can I implement this logic using Torque?


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to