I am having problems with one of my programs:
When I try to run the program the whole of the code seems to be regarded as a single transaction.
I have checked this using the transaction function (which I placed right at the top of the program, as soon as I try to run the program I am told a transaction is active).
The code is too large for me to reproduce here but I have found that when I comment out my main "FOR EACH" loop the transaction is no longer regarded as active, as soon as I remove the commenting the whole program once again becomes a transaction.
The "FOR EACH" is:
FOR EACH sinvo
WHERE nl-loc = "2"
AND sinvo.invoice-d ge vardate1
AND sinvo.invoice-d le vardate2 NO-LOCK:
much code (including database updates to tables other than sinvo)
END.
If anyone out there has any ideas as to why I get this large transaction I would be most grateful.
When I try to run the program the whole of the code seems to be regarded as a single transaction.
I have checked this using the transaction function (which I placed right at the top of the program, as soon as I try to run the program I am told a transaction is active).
The code is too large for me to reproduce here but I have found that when I comment out my main "FOR EACH" loop the transaction is no longer regarded as active, as soon as I remove the commenting the whole program once again becomes a transaction.
The "FOR EACH" is:
FOR EACH sinvo
WHERE nl-loc = "2"
AND sinvo.invoice-d ge vardate1
AND sinvo.invoice-d le vardate2 NO-LOCK:
much code (including database updates to tables other than sinvo)
END.
If anyone out there has any ideas as to why I get this large transaction I would be most grateful.