lifesupport
Programmer
The replace below sometimes works and sometimes does not. I wanted to use a 'replace all' as opposed to a scan loop because a 'replace all' is faster. Currently I have a scan loop and replace each record individually and it's reliable, but my client says it's too slow. What makes the 'replace all' unstable? Thanks
Select tmpratefile
Index ON dircode TAG dirprod
Set ORDER TO dirprod
Go top
Select rankfile
Set ORDER TO
Go top
Set relation TO dircode INTO tmpratefile
Set Multilocks On
CursorSetProp('buffering',3,'rankfile')
Replace ALL rankfile.RATE With tmpratefile.RATE FOR ((tmpratefile.dircode+tmpratefile.prodcode)=(rankfile.dircode+rankfile.APRODUCT))
Tableupdate(0,.T.,'rankfile')
Flush
Select tmpratefile
Index ON dircode TAG dirprod
Set ORDER TO dirprod
Go top
Select rankfile
Set ORDER TO
Go top
Set relation TO dircode INTO tmpratefile
Set Multilocks On
CursorSetProp('buffering',3,'rankfile')
Replace ALL rankfile.RATE With tmpratefile.RATE FOR ((tmpratefile.dircode+tmpratefile.prodcode)=(rankfile.dircode+rankfile.APRODUCT))
Tableupdate(0,.T.,'rankfile')
Flush