2

I want to store decimal float values in a table with column of type DECFLOAT using db2 library and c++. I understand that SQLDECIMAL64 and SQLDECIMAL128 have been added for storing decimal float values. Now to insert data into this DECFLOAT column how do I assign value to SQLDECIMAL64 or SQLDECIMAL128 as these are unions.

Is there any c++ data type that can be used to store decimal float value in the range of SQLDECIMAL64 or SQLDECIMAL128 and that can be inserted in DECFLOAT?

David Bohunek
  • 3,181
  • 1
  • 21
  • 26
Hudson
  • 21
  • 2

1 Answers1

0

As you've already mentioned the data type is a struct and as with all these types they have to be constructed to be used accordingly. There is no C/C++ data type which can be mapped 1:1.

Unfortunately there's no example on how to do this in the DB2 LUW documentation, but there's one in the documentation for zOS:

Examples of using decimal floating point data should give you an idea how to use it in your code.

tessus
  • 148
  • 7