Hi All. Hopefully someone can help us with our problem. I work on a client server application where we have a client that talks to a headless image which in turn talks to the database. Now...on the database
we have specified a column as decimal (31, 2). When our headless image trys to put a value in that column...it bombs with the following error:
AbtError: rc=-1 for '22005' in an AbtIbmCliCSDatabaseConnection at (4/3/2008 10:15:28 AM) '[SQLSTATE=22005 - [IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005 [Native Error=-99999]]
Now..this just started with our upgrade to 7.x from 6.x. I believe the problem is due to changes made on the Decimal conversion code. Here is the code from 6.02:
The value that we are sending when we get the error is 794596.59. That is the value that we are sending to these methods below.
AbtDatabaseDecimalField>>put:intoRecord:parentOffset:
| numericBA |
numericBA :=
(self valueAsSQLString: obj) asByteArray.
aRecord data
abtByteArrayAt: anOffset + offset
put: numericBA
length: (self baseLength)
pad: self padChar.
aRecord valueLengthFor: self put: (numericBA size)
This code works just fine as it is padding with Nul on the right up to the size of the field.
But here is the new code:
AbtDatabaseDecimalField>>put:intoRecord:parentOffset:
| numericBA |
##PTR==##PQ79198.
numericBA := self sqlStringAsPaddedDecimalBytearray: (self valueAsSQLString: obj).
numericBA memcpyFrom: 0
to: numericBA size - 1
into: aRecord data
startingAt: aParentOffset + offset.
aRecord valueLengthFor: self put: numericBA size
As you can see...in 7.x the code changed and now the value is padded on the right with zeros instead of Nul. For some reason this breaks any insert or update to that database column.
Can someone please from Instantiations please have a look at this and fix as we have customers that are dealing with this as we speak?
Thanks in advance,
Matthew MacMillan
Checkfree is now a part of Fiserv.