Feedback
Did this article resolve your question/issue?

   

Article

Unexpected behavior of non-finite double parameter passed to dynamic SQL using OpenAccess SDK

Information

 
TitleUnexpected behavior of non-finite double parameter passed to dynamic SQL using OpenAccess SDK
URL Nameunexpected-behavior-of-non-finite-double-parameter-passed-to-dynamic-sql-using-openaccess-sdk
Article Number000124219
EnvironmentProduct: Openaccess SDK
Version: 8.1
OS: Windows
Database: All supported databases
Application: All supported applicaitons
Question/Problem Description
Parameterized update query on double data type with a value provided as non-finite (e.g negative infinity, NaN or positive infinity) should fail due to the non-finite value being provided. Update succeeded and when the value was inspected it had been converted to a +1 or -1.
Steps to Reproduce
Clarifying Information
For update on double value: ∞
Expected: ∞ | Returned instead: 1

For update on double value: -∞
Expected: -∞ | Returned instead: -1

For update on double value: NaN
Expected: NaN  | Returned instead: -1

For update on double value: 1.79769313486232E+308
Expected: 1.79769313486232E+308 | Returned instead: ∞

For update on double value: -1.79769313486232E+308
Expected: -1.79769313486232E+308 | Returned instead: -∞
Error Message
Defect NumberDefect OASL-227
Enhancement Number
Cause
The value returned by the call to dam_getValueToSet() was returned incorrectly.
Resolution
Fixed in hot fix 8.1.0.0088.
Refer to article   OpenAccess SDK hot fix download and install instructions for instructions on how to download and install the hot fix.

The OpenAccess SDK is fixed to handle the different boundary values of double type. The SDK will map these values to specific string syntax's and pass it to IP for formatting in the statement.
  1. Double.PositiveInfinity will get passed to IP as “+INF”
  2. Double.NegativeInfinity as “-INF”
  3. Double.NAN as “NAN” 
  4. Double.MaxValue as 1.79769313486232E+308
  5. Double.MinValue as -1.79769313486232E+308
Note that the Double.MaxValue and Double.MinValue are actually out of standard double range and will not be able to store them properly in the database. It will throw value out of range error from backend database.

Once IP has these values (+INF,-INF and NAN), one can either choose to pass them in the back-end understandable format (if back-end supports storing these values) or can choose to throw appropriate errors.
Workaround
Notes
Last Modified Date11/20/2020 7:03 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.