EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB218359: Error " Execute Query failed..Syntax error, expect something like an 'OR' keyword or ')' between an integer and "." " is received when running a report against Teradata using MicroStrategy 9.x -10.x


Community Admin

• Strategy


This technical note describes an issue seen where as database error is received when filtering or drilling on an attribute with time data. This issue is specific to a Teradata warehouse for column data types set to ‘INTEGER 99:99:99’ format.

SUMMARY
This technical note describes an issue seen where as database error is received when filtering or drilling on an attribute with time data. This issue is specific to a Teradata warehouse for column data types set to ‘INTEGER 99:99:99’ format.
SYMPTOM
In Strategy Developer or Desktop, users receive the following error message when running a report against a Teradata database:


Error: SQL Generation CompleteQueryEngine encountered error: Execute Query failed..Syntax error, expect something like an 'OR' keyword or ')' 
between an integer and "."

STEPS TO REPRODUCE

  1. Using a Teradata warehouse, create a table with a column type of INTEGER FORMAT ’99:99:99’
  2. In Strategy Developer or Desktop, import this table into a project and create an attribute mapped to this table. The attribute form alias gets created with an INTEGER data type. 
  3. Create a report with this attribute in the filter.
  4. Execute the report to receive the error.
  5. View the report SQL, notice the ‘where’ clause displays the data as TIME instead of an integer.


select a11.end_tm end_tm from REVENUE a11 where a11.start_tm in (8:25:00 AM)

CAUSE
INTEGER HH:MM:SS data type is handled differently in ODBC and SQL mode. On Strategy Developer/Desktop warehouse catalog, SQL mode is used and the column is fetched as an INTEGER data type. This is the reason why the column alias of this attribute form is of data type INTEGER. However, when retrieving the data for the prompt elements or filter elements, ODBC mode is used and this fetches the data in TIME format. This special behavior of the INTEGER HH:MM:SS format is explained in the Teradata documentation available in the following link:
http://www.info.teradata.com/htmlpubs/DB_TTU_14_10/index.html#page/Connectivity/B035_2498_082K/2498ch03.20.06.html#ww619014
Note:
The Strategy warehouse catalog can be forced to use ODBC mode and retrieve the column as a TIME data type. However, in that case, the SQL generated as per the TIME data type will result in the error on the Teradata side:

‘[Teradata Database]Invalid operation on an ANSI DateTime or Interval value’

 This is again because of the special handling of the INTEGER HH:MM:SS data type on the Teradata side.
ACTION
Set the column type in the Teradata warehouse to INTEGER instead of the special format of ‘INTEGER 99:99:99’. Teradata is deprecating this data type. Refer to the following article for more information: 
http://www.info.teradata.com/htmlpubs/DB_TTU_13_10/index.html#page/Connectivity/B035_2509_071A/2509appe.12.1.html


Comment

0 comments

Details

Knowledge Article

Published:

May 12, 2017

Last Updated:

December 19, 2017