|
I have a SQL RPGLE program reading from the input file and testing if a
record with the same part number exists in the target file. The input file
has duplicates and I am trying to filter out the duplicates.
The output file is cleared with DELETE ALL up front.
The process is
1. read input file.
2. use Select count(*) counting if the part number exists in the output
file.
SELECT COUNT(*) into :COUNT from INPUTFILE WHERE PART_NO = :PART
3. if it does not exist, I do an INSERT.
4. if it exists, I update the record with the latest values.
5 Read next input record.
I have the isolation level set to *none. The file is a new file and is not
journaled.
Problem:
The count process does not see the records already inserted so I am getting
duplicates written to the file. Its almost like the program needs a COMMIT
executed after each INSERT.
Why does the program not find the records it has written?
TIA
Darryl Freinkel.
As an Amazon Associate we earn from qualifying purchases.
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.