Page 1 of 1

SQL Query with multiple joins

Posted: Fri 12 Feb 2016 16:40
by stevechown
With the SSIS source component I am trying to run a query that uses inner joins with 3 tables. This always takes a long time as it appears unable to translate the query to SOQL. An example of this is:
Select qli.Id, q.Id,o.Id
FROM QuoteLineItem qli inner join Quote q
on qli.QuoteId = q.Id inner join Opportunity o
on q.OpportunityId = o.Id

If I do similar queries but using just the QuoteLineItem and Quote tables or just the Quote and Opportunity tables it does translate this and works well. Am I doing something wrong ?

Extract from the website documentation for Query Translation :
Two kinds of JOINs can be translated to SOQL: LEFT JOIN (or LEFT OUTER JOIN) and INNER JOIN. INNER JOIN can be used several times to connect more than two tables. However if you use LEFT JOIN, it should be the only JOIN in the statement.

Re: SQL Query with multiple joins

Posted: Mon 15 Feb 2016 12:04
by Shalex
Thank you for your report. Indeed, your SQL-92 query is translated to 3 separate SOQL SELECT statements. So all data from 3 tables are loaded in a local SQLite database, then joins are applied (locally). We have reproduced the issue. We will notify you when it is fixed.

Re: SQL Query with multiple joins

Posted: Fri 26 May 2017 18:30
by Shalex
The bug with translating multiple joins in SQL-92 statement to one SOQL query is fixed in the new build dotConnect for Salesforce 3.2.280: https://www.devart.com/dotconnect/sales ... story.html.