1

I have an SSIS (SQL Server Integration Services) 2008 package where Salesforce.com is the data source, and the below SOQL works fine to connect, taking the variable dt_last_success value that is the last time the package ran.

SELECT column1, column2, column3
FROM Health_Plan__History
WHERE  CreatedDate > <@User::dt_last_success> 

I'd like to add an OR clause such that if the char(1) variable @User::load_all_data = 'Y', it ignors the @dt_last_success and loads all data. When I try the below, I get an error in the below image.

SELECT column1, column2, column3
FROM Health_Plan__History
WHERE  CreatedDate > <@User::dt_last_success> 
   OR <@User::load_all_data> 'Y'

enter image description here

0

The where syntax in SOQL is limited to only use field expressions which are of this form:

fieldName comparisonOperator value

So your "value comparisonOperator value" isn't allowed - by the time the query reaches Salesforce that is what the query has been turned into - and neither is "fieldName comparisonOperator fieldName".

You will have to look for a solution at the SSIS side e.g. leave out the where clause altogether if your flag is 'Y'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.