× 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.



Thanks Dave. You're right, I was trying to do a

chain
if not found
write
else
update
endif

I don't have another table. I'm modifying a program that writes out to the
table to send as a CSV.

I changed the table to have a primary key and did the RPG to check.



I understand what you're trying to accomplish, Art, but as Charles
pointed out the MERGE needs to find something. You're trying to save
yourself having to separately check if the row exists before deciding
whether to insert the row or update. When I've done this I joined the
table with another table that had related data in it to use when needing
to insert a new row in the first table. Thus, there would always be a row
for the MERGE to find but one side of the join would be NULL columns if
the row did not exist in the first table. Thus, the MERGE could either
MATCH or NOT MATCH as appropriate. Do you have a related table you can
join to your table?

Sincerely,

Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.