I run this in Teradata and out of Access as a pass through and it works fine. I try it in Alteryx 11.3 and I get error.
Error SQLPrepare: [Teradata][ODBC Teradata Driver][Teradata Database] syntax error: expected something between the word 'field1,storehierarchy' and '.'.
Select
store_hierarchy.field1,
store_hierarchy.field2,
....... more code ........
group by 1,2,3,4
Solved! Go to Solution.
I've noticed that Alteryx doesn't always recognize linebreaks when writing SQL within the Input tool. If you add a space after select and maybe in between the fields does it then work?
We would have never figured that out in a thousand years. Thanks soo much.
Ah spacing!
Yes, I copied and pasted a query from Teradata SQL Assistant (with the "Format Query" option on) and received the same error. Made sure there was a space after the Select, From, Where and it worked.
Thanks a lot it helped me too.
Thanks for your suggestion.
I had the same error, but I saved my query anyway while I went to search for the solution. When i came back to resolve the line breaks (having read your post), Alteryx sorted it out itself. I guess what happened was, when I closed the input tool having pasted my query into the SQL editor, Alteryx removed any formatting of the query (it all gets displayed as one line anyway). But the error message persisted nevertheless, until I went back into the 'edit query' mode, when I found that the SQL I pasted was now all displayed as one long string. I didn't change a thing, just clicked apply settings, and the error disappeared. It could have been designed better.
You can also follow the below steps to automatically fix the query:
1. Once you paste the SQL query in the SQL Editor open the 'Visual Query Builder' tab (It is two tabs left of 'SQL Editor').
2. After this open the SQL Editor tab again.
Doing this takes care of the spacing issues mentioned in this thread