Teradata Studio - Parsing Error

Teradata Studio

Teradata Studio - Parsing Error

The following query works fine on SQL assistant (on Windows)

 

WITH t1 AS (

SELECT CURRENT_TIMESTAMP AS ts

)

SELECT * FROM t1;

 

However it gives Parse Error splitting statement in Teradata Studio (I have a Mac version 15.11).

If I change it as below, it works fine.  Shouldn't the behavior be same on both the clients?

 

WITH t1(ts)  AS (

SELECT CURRENT_TIMESTAMP AS ts

)

SELECT * FROM t1;


Accepted Solutions
Teradata Employee

Re: Teradata Studio - Parsing Error

You have found an error in the parser that is embedded in Teradata Studio. There are different parsers used depending on the version of Teradata you are connected to. The embedded parser has an error for Teradata 14.10 and earlier when it is dealing with the WITH clause when it doesn't contain the columns list. The Teradata grammar changed for Teradata 15.0 for that clause. The problem does not happen when Studio uses our 15.0 or later parsers.

 

Even though our parser mistakenly reports a syntax error, the statement can be run by using the "Execute All" menu item.

1 ACCEPTED SOLUTION
6 REPLIES
Teradata Employee

Re: Teradata Studio - Parsing Error

The statement works fine in Teradata Database version 15.00 and 15.10 with no parsing errors. But when I try with a connection profile for Teradata 14.0.1. it fails and shows a parsing error. The following error is returned from the Database: Executed as Single statement. Failed [3706 : 42000] Syntax error: expected something between the word 't1' and the 'AS' keyword. When I used your second statement in Teradata 14.0.1, it was successful. This appears to be a Teradata Database syntax change some time after 14.0 that allows the WITH clause without having to aulaify t1.

Re: Teradata Studio - Parsing Error

I'm connecting to the same database (Teradata 14.0) using both the clients.

Re: Teradata Studio - Parsing Error

I installed Teradata Studio 15.12.. this time it does not even show the error message.

Teradata Employee

Re: Teradata Studio - Parsing Error

If you  execute the statement on Teradata Database 14.0, you should see a syntax error in the SQL History.

Teradata Employee

Re: Teradata Studio - Parsing Error

You have found an error in the parser that is embedded in Teradata Studio. There are different parsers used depending on the version of Teradata you are connected to. The embedded parser has an error for Teradata 14.10 and earlier when it is dealing with the WITH clause when it doesn't contain the columns list. The Teradata grammar changed for Teradata 15.0 for that clause. The problem does not happen when Studio uses our 15.0 or later parsers.

 

Even though our parser mistakenly reports a syntax error, the statement can be run by using the "Execute All" menu item.

Re: Teradata Studio - Parsing Error

That's right Execute All gives the result. Executing as individual statement has an error.

 

Please fix this issue in the later release of Teradata Studio.