The following code reads a text file to import records. I receive modal pop-ups with a warning when a unique record already exists. I would like to just ignore these and move to the next record, but I am unable. Is there any way to do this without expressly finding whether the unique record key already exists?
INPUT from value("C:\TestDir\TestFile").
REPEAT ON ERROR UNDO, NEXT:
IMPORT TestTable NO-ERROR.
END.
INPUT CLOSE.
I tested to determine when I receive the warning and it is not in the IMPORT statement but apparently at the beginning of the next iteration of the REPEAT. I assume this is the point where the last transaction is comitted. I also assumed that the ON ERROR UNDO, NEXT would circumvent this problem. . . but was obvously wrong.
INPUT from value("C:\TestDir\TestFile").
REPEAT ON ERROR UNDO, NEXT:
IMPORT TestTable NO-ERROR.
END.
INPUT CLOSE.
I tested to determine when I receive the warning and it is not in the IMPORT statement but apparently at the beginning of the next iteration of the REPEAT. I assume this is the point where the last transaction is comitted. I also assumed that the ON ERROR UNDO, NEXT would circumvent this problem. . . but was obvously wrong.