We're excited to announce that we'll be partnering with Credly starting October 19th - see what this means and read the announcement blog here!

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

SQL error that I only get in Alteryx

11 - Bolide

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 '.'.







.......  more code  ........


group by 1,2,3,4





11 - Bolide

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?  

11 - Bolide

We would have never figured that out in a thousand years.  Thanks soo much.

11 - Bolide

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.


7 - Meteor

Thanks a lot it helped me too. 

5 - Atom

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.

5 - Atom

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