This is just to remind myself how to fix of fatal error 112 to save for future. It happens when the query does not have a current record to commit to database.
It is very easy to fix since this is just a code error from the developers.
The original script:
function check.gvlot.table()
{
gvlot.company = get.compnr()if gvlot.company <> 100 then
cmpok = switch.to.company(100)
endifselect tdsls976.*
from tdsls976 for update
where tdsls976.bcmp = :gvlot.company
and tdsls976.btch = :arg.batch
and tdsls976.clot <> :tdltc001.clot
selectdo
tdsls976.clot = tdltc001.clot
db.update(ttdsls976)
commit.transaction()
endselectcmpok = switch.to.company(gvlot.company)
}

Correct script:
function check.gvlot.table()
{
gvlot.company = get.compnr()if gvlot.company <> 100 then
cmpok = switch.to.company(100)
endifdb.retry.point()
select tdsls976.*
from tdsls976 for update
where tdsls976.bcmp = :gvlot.company
and tdsls976.btch = :arg.batch
and tdsls976.clot <> :tdltc001.clot
selectdo
tdsls976.clot = tdltc001.clot
db.update(ttdsls976, db.retry)
commit.transaction()
endselectcmpok = switch.to.company(gvlot.company)
}
So it is very easy to just put one additional argument to the db.update!
It is always rare to find educated people about this matter, but you seem like you understand exactly what you are posting on! Appreciate it
Great post!