Unable to parse simple query: version 14.10.01

Teradata Studio
Teradata Employee

Re: Unable to parse simple query: version 14.10.01

Wes, What version of Aster database are you running your SQL against? One thing that was added in Studio 15.10 was an Aster parser for Aster 6.10 database. If you choose Execute As Individual for Aster 6.10, it will try to split the SQL statements (one or many) using the Aster parser. You can choose Execute All option from the SQL Editor context menu (right click), to bypass it parsing for syntax errors. It appears the Aster parser has a bug with switching the order of the trim and lower. We will report this and get it resolved. As mentioned, use Execute All to get around the issue. It also appears to be more strict about the final comma on CREATE.

Teradata Employee

Re: Unable to parse simple query: version 14.10.01

I know the topic is about Teradata Studio 14.10, but my question is about 15.10. I didn't want to start a new topic because I'm basically getting the same "Parse Error Splitting Statement" error. I connect to Aster 6.20 using the embedded jdbc driver. My Teradata Studio is version 15.10.01.201511052035. My SQL statement.

SELECT * FROM SOMESCHEMA.SOMETABLE
ORDER BY SOMECOLUMN;

Is there a way to disable the built-in parser in Teradata Studio and just pass the SQL as-is to the database? I know @fgrimmer already mentioned the Execute All work-around, but in the long run, wouldn't it be better to have the Database do the parsing anyway?

Teradata Employee

Re: Unable to parse simple query: version 14.10.01

@mlazatin, Yes, use Execute All to bypass the parser. Otherwise, Execute As Individual will use the parser to attempt to split the statement. 

Teradata Employee

Re: Unable to parse simple query: version 14.10.01

@fgrimmer, Thanks for the reply. Are there plans to put an option in the preferences to bypass the parser even for Execute as Individual?

Teradata Employee

Re: Unable to parse simple query: version 14.10.01

@mlazatin, Not currently. We need the parser to split the SQL from the editor. We can not rely on a semicolon to determine where the statements split. 

Teradata Employee

Re: Unable to parse simple query: version 14.10.01

I just realized that I get a "Parse error splitting statement" whenever I have an "ORDER BY" clause without a "WHERE" clause. So as a workaround, whenever I have an order by but have really no need for a where clause, I just add a WHERE 1=1. So this:

SELECT * FROM MYTABLE
ORDER BY ID;

should be turned into:

SELECT * FROM MYTABLE
WHERE 1=1
ORDER BY ID;

@fgrimmer hopefully this gives us some clue on how to fix the "parse error splitting statement"

Teradata Employee

Re: Unable to parse simple query: version 14.10.01

I was able to recreate your issue with Aster 6.1 as well. This appears to be an Aster parser error. I will pass this on to the Aster team.