Folks:
I’m not sure if this issue is due to Spring framework or JT400.
I’ve got a merge statement that I’m running to do an ‘upsert’ operation.
----------
MERGE INTO file R
USING (values(:field1,:field2,:field3,:field4,:field5,
:field6,:field7))
AS N (field1,field2,field3,field4, field5,field6,field7)
ON (r.field1,r.field5) = (n.field1,n.field5)
WHEN MATCHED THEN
UPDATE SET (field2,field3,field4,field6,field7) =
(:field2,:field3,:field4,:field6,:field7)
WHEN NOT MATCHED THEN
INSERT (field1,field2,field3,field4, field5,field6,field7)
values(:field1,:field2,:field3,:field4,:field5, :field6,:field7)
—————
I’m processing the data in a batch, so I’m building an array of SqlParameterSource objects and then running batchUpdate on a NamedParameterJdbcTemplate object.
The return value I get back is an array of -2’s.
This indicates that the update operation could not determine the number of rows updated (I’m assuming via returned metadata). The data in the table is always updated correctly.
However, if I execute the update multiple times using the update method, I always get a return value of 1.
I would like to verify that the correct number of records were inserted or updated.
Any suggestions on where to look in order to get the correct number of records updated?
Thanks!
David
—
IBM i on Power Systems: For when you can't afford to be out of business!
I'm riding a in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness. You can make a tax deductible donation to my ride by visiting
https://mideml.diabetessucks.net. My goal is $7000 but any amount is appreciated.
You can see where my donations come from by visiting my interactive donation map ...
https://mideml.diabetessucks.net/map (it's a geeky thing).
I may have diabetes, but diabetes doesn't have me!
As an Amazon Associate we earn from qualifying purchases.