04-18-2019 08:25 PM
I know this is a very simple solution however I connect figure out the syntax in SL. I can pass this in a stored procedure on redship but when building it in my Pipeline using the Redshift execute it will not work and getting syntax error
It appears that it is trying to put the first part of the email as a column
Simple SQL
Select * from Snaplogic_space.SFDC_Leads_vw where SFDC_Leads_vw.email = ‘phubley@utahfilmcenter.org’
Snaplogic SQL pass Value form email above to a parameter
“SELECT *
FROM Snaplogic_space.SFDC_Leads_vw
WHERE SFDC_Leads_vw.email ==” + $Email + “”
Where $Email has a value of phubley@utahfilmcenter.org
Syntax Error
SettingsAccountViewsInfo
Label*
Redshift - Execute1
SQL statement*=
“SELECT *
FROM Snaplogic_space.SFDC_Leads_vw
WHERE SFDC_Leads_vw.email =” + $Email +“”
Pass through
Ignore empty result
Auto commit
Execute during preview
Failure: Failed to execute query: SELECT * FROM Snaplogic_space.SFDC_Leads_vw WHERE SFDC_Leads_vw.email =phubley@utahfilmcenter.org, Reason: Amazon Invalid operation: column “phubley” does not exist in sfdc_leads_vw;, Resolution: Please check sql query.
this seems so simple cannot figure out what I am doing wrong
04-18-2019 08:46 PM
I figured it out
“SELECT *
FROM Snaplogic_space.SFDC_Leads_vw
WHERE email ='” + $Email + “'”
If anyone was wondering. Just tired and forgot the single " ’ "
04-19-2019 06:33 AM
You should not have to make the SQL statement an expression in the snap, the following should directly work:
SELECT * FROM Snaplogic_space.SFDC_Leads_vw WHERE SFDC_Leads_vw.email = $Email
The snap will turn any property references (e.g. $Email) in the statement into a bound parameter when preparing the SQL statement.
04-26-2019 05:32 PM
Thank you very much that worked perfect