jaymukh
2nd May 2002, 20:42
How the locking should be done?
Will this code will work or another person still can get the same order number from another login.
select tcmcs047.*
from tcmcs047 for update
where tcmcs047.ckon = tcckon.act.sls
and tcmcs047.grno = :ord.ser
and tcmcs047._compnr = :sale.comp
order by tcmcs047._index1
selectdo
if tcmcs047.blck = tcyesno.no then
set.orno = ord.ser * 100000 + tcmcs047.ffno
endif
tcmcs047.ffno = tcmcs047.ffno + 1
db.update(ttcmcs047, db.retry)
endselect
Will this code will work or another person still can get the same order number from another login.
select tcmcs047.*
from tcmcs047 for update
where tcmcs047.ckon = tcckon.act.sls
and tcmcs047.grno = :ord.ser
and tcmcs047._compnr = :sale.comp
order by tcmcs047._index1
selectdo
if tcmcs047.blck = tcyesno.no then
set.orno = ord.ser * 100000 + tcmcs047.ffno
endif
tcmcs047.ffno = tcmcs047.ffno + 1
db.update(ttcmcs047, db.retry)
endselect