I am Trying to insert a query from Amazon Redshift as data input. The query creates a temporary table and it gives me this error:
"Error SQLPrepare: [Amazon][Amazon Redshift] (30) Error occurred while trying to execute a query: [SQLState 42601] ERROR: cannot insert multiple commands into a prepared statement"
The query looks somewhat like this:
I am not an expert but based on your error, it is stating that you cannot run multiple commands - you are doing exactly that with DROP TABLE, CREATE TABLE, SELECT - which is why it is failing.
Not sure if you can wrap the whole thing as a stored proc and call that as a command.