I am trying to send an update statement to PostGres, with a dynamic substitution in the syntax, as I have done before with "regular" MS SQL.
So, I took a delete syntax from another MSSQL that work nicely (see attachment) with the query in the input data source:
SELECT 1 as Deleted;
delete from Data.Responses where ResponseId in (RESPONSEIDSREPLACE);
And then a "Modify SQL Query" replacing the string RESPONSEIDSREPLACE with a concatenated string holding the relevant IDs.
Works nicely with MSSQL. So I took it and reworked a bit to use for PostGres:
Have you tried using the IN syntax rather than just the =? Like "InitStatusId" IN ('1234','5678')
Yes, that was my original syntax, since I wanted to update via a concatenated string of Ids (Update table set InitStatusId = '2' WHERE Ids IN ('aa','bb','cc'))
That failed as well.
When the syntax was in the "Table or Query" field I get the "ERROR: syntax error at end of input¶LINE 1: SELECT * FROM ¶ ^¶" because Alteryx can't handle a syntax other than SELECT * FROM for PostGres SQL here
Moving the syntax to the "Post SQL Statement" field gave me the error that the field were not replaced with my concatenated string: "ERROR: column "replace" does not exist¶LINE 1: ...set "InitStatusId" = '2' WHERE "TransactionKey" IN (REPLACE)¶ ^"