This task requires me to find certain product code in the database and replace it with something else. There are about 1000 product code and about 5 million related records to work on. This is what I have so far.
def var lv-prim-index as char no-undo.
def var lv-file as char no-undo.
for each _field
where _field._field-name matches "prod_cd*"
no-lock:
find first _file
where recid(_file) = _field._file-recid
no-lock no-error.
if available _file then
do:
find first _index
where recid(_index) = _file._prime-index
no-lock no-error.
if available _index then
assign
lv-prim-index = _index.
run clean_prod_I.p _file._file-name _field._field-name "newCode" "oldCcode" lv-prim-index.
end.
end.
and clean_prod_I.p now is just do a simple display.
My problem is speed. For one testing product code. It took abouot 2 hours to do. I need something much better than what I have.
thanks for the help!
def var lv-prim-index as char no-undo.
def var lv-file as char no-undo.
for each _field
where _field._field-name matches "prod_cd*"
no-lock:
find first _file
where recid(_file) = _field._file-recid
no-lock no-error.
if available _file then
do:
find first _index
where recid(_index) = _file._prime-index
no-lock no-error.
if available _index then
assign
lv-prim-index = _index.
run clean_prod_I.p _file._file-name _field._field-name "newCode" "oldCcode" lv-prim-index.
end.
end.
and clean_prod_I.p now is just do a simple display.
My problem is speed. For one testing product code. It took abouot 2 hours to do. I need something much better than what I have.
thanks for the help!