I have an application that uses a prg central code to update quantity on hand of several items.
This works well, this program process about 35,000 records in a month, BUT SOMETIMES, the replace is not making its job and 7 or 8 records does are not replaced in a month.
I was triyng to find a path or event that makes this happen, even I known exactly when the program mistakes via a logfile when this happen.
I quit the buffering for this table, and I dont known what else to do to ensure flush the changes to disk.
Theres part of code:
SELECT salarti
v_saldoante = salarti.saluncomp
REPLACE salarti.saluncomp WITH salarti.saluncomp + (movinv.movunidad * movinv.movfacuni + movinv.movunibon) IN salarti
FLUSH
v_saldodesp = salarti.saluncomp
SELECT salarti
IF v_saldoante = v_saldodesp .AND. (movinv.movunidad * movinv.movfacuni + movinv.movunibon) != 0 && This means that after the update, wasn't updated.
= GRA_ERROR() && Write log with error detail
ELSE
FLUSH
GO TOP
ENDIF
1. Even in a document with several records, the program process all of them OK, except the one that makes the problem (and always appear in the log file).
2. Is there a way to write on stone the replace? (bulletproof)
3. Do I have to move the pointer or what?
Please, I known there are friendly genius minds listen my prayers, give me a hand.
Jose Carlos Sanchez.
PS. By the way, excuse the span-glish and thanks to Ramani, Tom and all the guys that helps before.
This works well, this program process about 35,000 records in a month, BUT SOMETIMES, the replace is not making its job and 7 or 8 records does are not replaced in a month.
I was triyng to find a path or event that makes this happen, even I known exactly when the program mistakes via a logfile when this happen.
I quit the buffering for this table, and I dont known what else to do to ensure flush the changes to disk.
Theres part of code:
SELECT salarti
v_saldoante = salarti.saluncomp
REPLACE salarti.saluncomp WITH salarti.saluncomp + (movinv.movunidad * movinv.movfacuni + movinv.movunibon) IN salarti
FLUSH
v_saldodesp = salarti.saluncomp
SELECT salarti
IF v_saldoante = v_saldodesp .AND. (movinv.movunidad * movinv.movfacuni + movinv.movunibon) != 0 && This means that after the update, wasn't updated.
= GRA_ERROR() && Write log with error detail
ELSE
FLUSH
GO TOP
ENDIF
1. Even in a document with several records, the program process all of them OK, except the one that makes the problem (and always appear in the log file).
2. Is there a way to write on stone the replace? (bulletproof)
3. Do I have to move the pointer or what?
Please, I known there are friendly genius minds listen my prayers, give me a hand.
Jose Carlos Sanchez.
PS. By the way, excuse the span-glish and thanks to Ramani, Tom and all the guys that helps before.