Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

SQL error that I only get in Alteryx

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

 

 

Select

store_hierarchy.field1,

store_hierarchy.field2,

 

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

 

group by 1,2,3,4

 

 

 

 

6 REPLIES 6
nick_ceneviva
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?  

Brad1
11 - Bolide

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

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

 

mohdfaraz47
7 - Meteor

Thanks a lot it helped me too. 

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

Gqndhi
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

 

 

 

Labels