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

KB453888: Data truncation with SAP HANA smalldecimal datatype


Community Admin

• Strategy


This article provides a workaround for the error encountered when running a report against SAP HANA.

Symptom:
While running a report against SAP HANA a user will see the following error:  "Error: QueryEngine encountered error: FetchScroll. 
Error type: Odbc success with info. Odbc operation attempted: SQLFetchScroll. [01004:0: on SQLHANDLE] [SAP AG][LIBODBCHDB DLL] Data truncated."

Reason:

The user will see this error if the report SQL contains a column with the smalldecimal data type. This has been identified as a SAP HANA ODBC Driver issue. Strategy obtains column information from the ODBC call SQLDescribeCol to determine how to bind results for returning to the application.  The SAP HANA  driver is incorrectly returning a scale of zero for the SMALLDECIMAL data type.  This leads MSTR to bind the column as an integer type (no scale) which means the numbers to the right of the decimal point are removed and the driver returns a data truncation warning message.

Workaround:

To work around this in Strategy, edit the report attribute that has small decimal datatype.
 1. Modify the attribute form
2. Modify the form expression
3. Add the following to the form expression
ApplySimple("CAST (#0 AS DECIMAL(16,4))", [DT_SMALLDECIMAL])
4. Save and close your changes and update the schema
5. You should be successfully able to run the report and view the data
Other work around options available to avoid this issue:

  1. Create a view in the SAP HANA database where the smalldecimal column is cast as decimal.  Use this view instead of the table to build Strategy objects.
  2. Create a Logical View in Strategy where the user can specify the SQL and explicitly cast the smalldecimal data type as decimal

Comment

0 comments

Details

Knowledge Article

Published:

July 21, 2017

Last Updated:

July 21, 2017