Sample Progress 4GL Query to check duplicate customer in the table
Sample Query to check duplicate customer in the table
Define buffer mBuf FOR xx_mstr.
Define buffer kBuf FOR xx_mstr.
Define temp-table tt
Field tt_recid as recid .
Empty temp-table tt.
Output to "Duplicate_records.xls".
FOR EACH each xx_mstr no-lock :
FIND first tt where tt_recid = recid(xx_mstr) no-lock NO-ERROR.
IF avail tt THEN next.
FIND First mBuf where mBuf.cust-num = xx_mstr.cust-num and recid(mBuf) <> recid(xx_mstr) no-lock no-error.
IF avail mBuf THEN
do:
Export delimiter "~011" mBuf.
FOR EACH kbuf where kbuf.cust-num = xx_mstr.cust-num :
create tt
Assign
tt_recid = recid(mBuf).
END.
End.
END.
output close.
Define buffer mBuf FOR xx_mstr.
Define buffer kBuf FOR xx_mstr.
Define temp-table tt
Field tt_recid as recid .
Empty temp-table tt.
Output to "Duplicate_records.xls".
FOR EACH each xx_mstr no-lock :
FIND first tt where tt_recid = recid(xx_mstr) no-lock NO-ERROR.
IF avail tt THEN next.
FIND First mBuf where mBuf.cust-num = xx_mstr.cust-num and recid(mBuf) <> recid(xx_mstr) no-lock no-error.
IF avail mBuf THEN
do:
Export delimiter "~011" mBuf.
FOR EACH kbuf where kbuf.cust-num = xx_mstr.cust-num :
create tt
Assign
tt_recid = recid(mBuf).
END.
End.
END.
output close.
Comments