× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.