Hi
Please help on below:-
We are getting this error-> "XXX has NO-LOCK status, update to field not allowed. (396)
** Unable to update XXX. (142)"
In my application program, Multiple update statements are running in a block and we fetched table using "Exclusive-lock" but during execution of application on each update statement throwing above given error.
Is there any issue in progress 11.5 to use prompt-for and update statement . Please Suggest.
thanks
Hi Ezaz. A sample of the code would be really helpful in assisting you with this. Can you recreate it with a simple example?
This is the block where we are updating the records in the database
and we are getting above error
on "c", "C" of br-lead-dist in frame f-lead-dist
do:
message "inside" view-as alert-box.
vr-recid = recid(lead-dist).
find lead-dist exclusive-lock
where recid(lead-dist) = vr-recid.
message transaction view-as alert-box.
display
vc-vendor-display
+ " "
+ vc-vendor-name
@ vc-vendor-display format "x(20)"
lead-dist.vend-addr-bk-no
lead-dist.dist-no
lead-dist.effective-date
with frame f-change.
/*prompt-for
lead-dist.effective-date
with frame f-change.
*/
message "prompt---bfr" "vr-recid" vr-recid skip "avail" available(lead-dist) skip locked(lead-dist) view-as alert-box.
if can-find(b-lead-dist no-lock
where b-lead-dist.dist-no = lead-dist.dist-no
and b-lead-dist.vend-addr-bk-no =
lead-dist.vend-addr-bk-no
and b-lead-dist.effective-date =
input lead-dist.effective-date
and recid(b-lead-dist) <> vr-recid)
then do:
message color update
"Record already exists for the dist/vendor/date entered"
view-as alert-box information.
undo, retry.
end.
message "Locked : " locked(lead-dist) view-as alert-box.
assign lead-dist.effective-date = 01/01/2009 /*input lead-dist.effective-date*/ .
message "Date : " lead-dist.effective-date view-as alert-box.
vc-region = "Not Found".
find dist where dist.dist-no = lead-dist.dist-no no-lock no-error.
if available dist then
do:
find region where region.reg-no = dist.reg-no no-lock no-error.
if available region then
vc-region = region.reg-name.
end.
display vc-region with frame f-change.
vd-prior-value = lead-dist.prem-gross-rate.
update
lead-dist.bill-threshold-wgt
lead-dist.pay-threshold-wgt
lead-dist.prem-gross-rate
with frame f-change.
message "-------------------1-------------------------------" view-as alert-box.
if vd-prior-value <> lead-dist.prem-gross-rate then
lead-dist.prem-lead-rate = round(lead-dist.prem-gross-rate / .53, 4).
vd-prior-value = lead-dist.mkt-gross-rate.
update
lead-dist.prem-lead-rate
lead-dist.mkt-gross-rate
with frame f-change.
if vd-prior-value <> lead-dist.mkt-gross-rate then
lead-dist.mkt-lead-rate = round(lead-dist.mkt-gross-rate / .53, 4).
vd-prior-value = lead-dist.gross-price.
update
lead-dist
.mkt-lead-rate
lead-dist.ar-due-days
lead-dist.ap-due-days
lead-dist.gross-price
with frame f-change.
if vd-prior-value <> lead-dist.gross-price then
lead-dist.lead-price = round(lead-dist.gross-price / .53, 4).
update
lead-dist.lead-price
lead-dist.receipt-opt
lead-dist.participant
lead-dist.prem-opp
with frame f-change.
hide frame f-change.
run ip-open-query.
end.
PROCEDURE ip-open-query.
frame f-lead-dist:title =
if not vl-current-only
then " DISTRIBUTOR LEAD FILE - All Records Fitting Qualify Criteria "
else " DISTRIBUTOR LEAD FILE - Currently Active Fitting Qualify Criteria ".
open query q-lead-dist
for each lead-dist no-lock.
enable all with frame f-lead-dist.
END.
> We are getting this error->
> "XXX has NO-LOCK status, update to field not allowed. (396)
> ** Unable to update XXX. (142)"
Which buffer name is shown for "XXX"?
Might you have some assignment with an unqualified field name that resolves to another no-locked buffer for the same table? Or a duplicate variable name that actually resolves to a field name? "Unable to update" can refer to assignments too, not just UPDATE or PROMPT-FOR.
i have replaced actual label with xxx
Yes, I see that. But what is the actual label? It is difficult to match the error messages to the code you posted without the label...
its just a label declared for the database field that is outputted as lead ditribution
Ok, forget the label, but which table or buffer does it refer to?