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

KB11973: Use of database reserved key words as an object alias generates incorrect SQL and returns an odbc error message


Stefan Zepeda

Salesforce Solutions Architect • Strategy


KB11973: Use of database reserved key words as an object alias generates incorrect SQL and returns an odbc error message

SYMPTOM:
When an attribute form uses database reserved keywords as an alias, the SQL Engine returns an odbc error. These keywords are database specific, and the specific error may be slightly different for each database.
 
For example, use 'Desc' as a column alias for an attribute as shown in the image below:

ka02R000000kYOtQAM_0EM440000002Fhf.jpeg

 
Attempt to execute the report, and the following error message is received:
 

ka02R000000kYOtQAM_0EM440000002Fhg.jpeg

 
Report: Error Report
 
Job: 481
 
Status: Execution failed
 
Error: SQL Generation CompleteQueryEngine encountered error: Execute Query failed. Error type: Odbc error. Odbc operation attempted: SQLExecDirect. The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. Error in Process method of Component: QueryEngineServer, Project 0, Job 481, Error Code=-2147212544.
 
NOTE:
The error message is specific to the warehouse database. In this example, Microsoft Access is the warehouse database being used. Different databases will yield different error messages.
 
CAUSE:
Strategy SQL is using the database reserved keyword 'desc' as a column alias as per the form alias.
 
Note that the SQL below has 'desc' as the column alias:
select distinct a11. AS id,
a11. AS desc
from
ACTION:
Do not use database reserved key words as a column alias for Strategy objects. Database reserved keywords are database dependent. A list of these words can be found in each database's documentation, or consult your Database Administrator for more information on these reserved words.
 
 


Comment

0 comments

Details

Knowledge Article

Published:

June 8, 2017

Last Updated:

June 8, 2017