in reply to Re^2: Unable to run SQL query
in thread Unable to run SQL query

Try putting the prepare back in with $heredoc as its parameter.