Feedback
Did this article resolve your question/issue?

   

Article

SQLDescribeParam behavior change with Oracle WP driver

Information

 
TitleSQLDescribeParam behavior change with Oracle WP driver
URL NameSQLDescribeParam-behavior-change-with-Oracle-WP-driver
Article Number000185460
EnvironmentProduct: Connect(64) for ODBC Oracle Wire Protocol driver
Version: 7.1.5.263
OS: Windows
Database: Oracle
Application: All supported applications
Question/Problem Description
SQLDescribeParam against a query containing a function call returns SQL_VARCHAR size 999 for a parameter that was previously described as SQL_DECIMAL size 12.
Steps to Reproducecreate table testtable
(
ENTITY_FK NUMBER(12) NOT NULL,
MYGRP_MYCHLDGRP_MYCHILD2 VARCHAR2(4000),
MYNUMBER NUMBER,
MYRELATION VARCHAR2(500),
MYRELATION_FK NUMBER,
MYSTRING VARCHAR2(4000),
MYUNIT NUMBER,
MYUNIT_UNIT VARCHAR2(30),
MYUNIT_SV NUMBER,
MYVOCAB VARCHAR2(100),
MYDATE DATE,
MYGRP_MYCHLDGRP_MYCHILD1 VARCHAR2(4000)
)

create or replace function testfunc (param1 in number, param2 in number) return number deterministic is
retval number;
begin
retval:= param1 + param2;
return retval;
end;

SQLPrepare:
INSERT into testtable (entity_fk,mydate,mynumber, myunit) values (?,?,CASE WHEN ? IS NULL THEN NULL ELSE testfunc(?,?) END, ?)
Execute SQLDescribeParam for all 6 parameters. Parameters 1, 2, and 6 are described incorrectly.

Observed results:
SQLDescribeParam output for parameters 1, 2, and 6 is incorrect.

SQLPrepare:
In: StatementHandle = 0x00384C98, StatementText = "INSERT into testtable (entity_fk,mydate_,mynumber_...", TextLength = 129
Return: SQL_SUCCESS=0

SQLDescribeParam:
In: StatementHandle = 0x00384C98, ParameterNumber = 1, DataTypePtr = 0x00202CE8, ParameterSizePtr = 0x0021C158, DecimalDigits = 0x0021C170, NullablePtr = 0x0021C188
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x00384C98, ParameterNumber = 2, DataTypePtr = 0x00202CE8, ParameterSizePtr = 0x0021C158, DecimalDigits = 0x0021C170, NullablePtr = 0x0021C188
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x00384C98, ParameterNumber = 3, DataTypePtr = 0x00202CE8, ParameterSizePtr = 0x0021C158, DecimalDigits = 0x0021C170, NullablePtr = 0x0021C188
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x00384C98, ParameterNumber = 4, DataTypePtr = 0x00202CE8, ParameterSizePtr = 0x0021C158, DecimalDigits = 0x0021C170, NullablePtr = 0x0021C188
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x00384C98, ParameterNumber = 5, DataTypePtr = 0x00202CE8, ParameterSizePtr = 0x0021C158, DecimalDigits = 0x0021C170, NullablePtr = 0x0021C188
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x00384C98, ParameterNumber = 6, DataTypePtr = 0x00202CE8, ParameterSizePtr = 0x0021C158, DecimalDigits = 0x0021C170, NullablePtr = 0x0021C188
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

Expected results:
SQLPrepare:
In: StatementHandle = 0x006C4C98, StatementText = "INSERT into testtable (entity_fk,mydate_,mynumber_...", TextLength = 129
Return: SQL_SUCCESS=0

SQLDescribeParam:
In: StatementHandle = 0x006C4C98, ParameterNumber = 1, DataTypePtr = 0x004A2D00, ParameterSizePtr = 0x004BB900, DecimalDigits = 0x004BB918, NullablePtr = 0x004BB930
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_DECIMAL=3, *ParameterSizePtr = 12, *DecimalDigits = 0, *NullablePtr = SQL_NO_NULLS=0

SQLDescribeParam:
In: StatementHandle = 0x006C4C98, ParameterNumber = 2, DataTypePtr = 0x004A2D00, ParameterSizePtr = 0x004BB900, DecimalDigits = 0x004BB918, NullablePtr = 0x004BB930
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_TYPE_TIMESTAMP=93, *ParameterSizePtr = 19, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x006C4C98, ParameterNumber = 3, DataTypePtr = 0x004A2D00, ParameterSizePtr = 0x004BB900, DecimalDigits = 0x004BB918, NullablePtr = 0x004BB930
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x006C4C98, ParameterNumber = 4, DataTypePtr = 0x004A2D00, ParameterSizePtr = 0x004BB900, DecimalDigits = 0x004BB918, ullablePtr = 0x004BB930
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x006C4C98, ParameterNumber = 5, DataTypePtr = 0x004A2D00, ParameterSizePtr = 0x004BB900, DecimalDigits = 0x004BB918, NullablePtr = 0x004BB930
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_VARCHAR=12, *ParameterSizePtr = 999, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1

SQLDescribeParam:
In: StatementHandle = 0x006C4C98, ParameterNumber = 6, DataTypePtr = 0x004A2D00, ParameterSizePtr = 0x004BB900, DecimalDigits = 0x004BB918, NullablePtr = 0x004BB930
Return: SQL_SUCCESS=0
Out: *DataTypePtr = SQL_DOUBLE=8, *ParameterSizePtr = 53, *DecimalDigits = 0, *NullablePtr = SQL_NULLABLE=1
Clarifying Information
Error Message
Defect NumberDefect 40573
Enhancement Number
Cause
The parser for parameter arguments did not handle function calls properly.
Resolution
Fixed in hot fix 07.16.0270.
Refer to article Connect and Connect64 for ODBC hot fix download and install instructions for instructions on how to download and install the hot fix.
Workaround
Notes
Last Modified Date11/20/2020 7:22 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.