mark_h
12th July 2003, 01:14
Okay - what am I doing wrong and how do I solve this problem. I need to select some records on tpppc211, reverse them, then split the costs, then update the tpppc211.loco field so I know this record has been processed. I have tried a ton of different methods with a variety of errors. I know I am losing a pointer somewhere, but can not figure out where. Here is where it currently sits.
db.retry.point()
select tpppc211.*
from tpppc211 for update
where .....
selectdo
set_reversal_fields()
db.insert(ttpppc211,db.retry)
commit.transaction()
select table.xxx
from table.xxx
where .....
selectdo
set_split_fields()
db.insert(ttpppc211,db.retry)
commit.transaction()
endselect
tpppc211.loco = ...
db.update(ttpppc211,db.retry)
commit.transaction()
endselect
I have tried with no db.retry and commit for the reversal and split functions, but then the db.update just loops until I get the max retries error. With the retry and commit I get the record not locked error. Without the retry on the inserts, but with the commit I still get no current record. If I take out the last update everything works and runs okay. But I need the last update so I know what records have been processed. Any ideas? I know I am missing something basic with the commit and retry, but am drawing a blank.
Thanks
Mark
db.retry.point()
select tpppc211.*
from tpppc211 for update
where .....
selectdo
set_reversal_fields()
db.insert(ttpppc211,db.retry)
commit.transaction()
select table.xxx
from table.xxx
where .....
selectdo
set_split_fields()
db.insert(ttpppc211,db.retry)
commit.transaction()
endselect
tpppc211.loco = ...
db.update(ttpppc211,db.retry)
commit.transaction()
endselect
I have tried with no db.retry and commit for the reversal and split functions, but then the db.update just loops until I get the max retries error. With the retry and commit I get the record not locked error. Without the retry on the inserts, but with the commit I still get no current record. If I take out the last update everything works and runs okay. But I need the last update so I know what records have been processed. Any ideas? I know I am missing something basic with the commit and retry, but am drawing a blank.
Thanks
Mark