Feedback
Did this article resolve your question/issue?

   

Article

Warning returned by ODBC driver when binding timestamp parameters with a precision and scale

« Go Back

Information

 
TitleWarning returned by ODBC driver when binding timestamp parameters with a precision and scale
URL Name8788
Article Number000125560
EnvironmentProduct: Connect/Connect64 for ODBC driver
Version: All supported versions
OS: All supported platforms
Database: All supported databases
Application: Informatica PowerCenter
Question/Problem Description

Prepare a statement with a parameter for a timestamp column.  If you then call SQLBindParameter to bind the value for that column and specifiy a precision(ColumnSize) and scale(DecimalDigits), then you must specifiy a precision equal to 20 + the scale or the following warning is returned:

"Timestamp parameters with a scale, must have a scale less than ten and a precision equal to 20 plus the scale.  You specified a precision of x and scale of y.  Error in parameter z."

where
x = the precision you specified
y = the scale you specified
z = the parameter number

If you simply re-execute the statement after the warning, then the insert will succeed.

Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution

The driver imposes this restriction on parameter bindings and this is expected behavior.

You can set WorkArounds2=2 in your ODBC data source definition to cause the driver to ignore the ColumnSize/DecimalDigits specified in the call to SQLBindParameter which will result in no warning returned.

The ODBC Reference Guide defines WorkArounds2=2 as:

WorkArounds2=2.  Some applications incorrectly specify the ColumnSize/DecimalDigits when binding timestamp parameters.  This workaround causes the driver to ignore the ColumnSize/DecimalDigits
specified by the application and use the database defaults instead.

Workaround
Notes
References to other documentation:
Connect for ODBC Reference : "WorkAround Options"
https://www.progress.com/documentation/datadirect-connectors
Last Modified Date5/19/2016 10:33 PM
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.