Feedback
Did this article resolve your question/issue?

   

Article

Parameterized insert fails when tried to insert a negative decimal number with Hive ODBC driver

Information

 
TitleParameterized insert fails when tried to insert a negative decimal number with Hive ODBC driver
URL Nameparameterized-insert-fails-when-tried-to-insert-a-negative-decimal-number-with-hive-odbc-driver
Article Number000181404
EnvironmentProduct: Connect XE for ODBC Hive Wire Protocol driver
Version: 07.16.0381 (B0329, U0218)
OS: All supported platforms
Database: Hive 1.2.1
Application: All supported applications
Question/Problem Description
Parameterized insert fails when tried to insert a negative decimal number with Hive ODBC driver
Steps to Reproduce
Clarifying Information
1. CREATE TABLE TEST (c1 decimal (10,2)); 

2. SQLPrepare => INSERT INTO TEST VALUES (?)
SQLPrepare:
In:    StatementHandle = 0x02D4DF18, StatementText = "insert into TEST values (?)", TextLength = 29
Return:    SQL_SUCCESS=0

3. Bind the parameter as below and pass any negative number which starts with 0 (eg -0.71) as value to the parameter 
SQLBindParameter:
In:    StatementHandle = 0x02D4DF18, ParameterNumber = 1, InputOutputtype = SQL_PARAM_INPUT=1, ValueType = SQL_C_CHAR=1, 
ParameterType = SQL_DECIMAL=3, ColumnSize = 10, DecimalDigits = 2, ParameterValuePtr = "-0.71", BufferLength = 12, StrLen_or_IndPtr = SQL_NTS=-3, SQL_LEN_DATA_AT_EXEC = FALSE, 
Buffer Size = 600
Return:    SQL_SUCCESS=0

4. Execute    
SQLExecute:
In:    StatementHandle = 0x02D4DF18
Return:    SQL_ERROR=-1
stmt:    szSqlState = "37000", *pfNativeError = 40000, *pcbErrorMsg = 183
szErrorMsg = "DataDirectODBC Apache Hive Wire Protocol driverApache HiveError while compiling statement: FAILED: ParseException line 1:29 cannot recognize input near '.' '71' ')' in statement"

 
Error MessageError while compiling statement: FAILED: ParseException line 1:29 cannot recognize input near '.' '71' ')' in statement"
Defect NumberDefect 61963
Enhancement Number
Cause
Resolution
Fixed in 07.16.0384 (B0337, U0221)
Refer to "Connect and Connect64 for ODBC hot fix download and install instructions" for instructions on how to download and install the 
Workaround
Notes
Last Modified Date11/20/2020 7:17 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.