JRussell
30th October 2002, 11:35
Hi,
I have a problem with Error 206, Record is not locked.
I will try to explain what I am doing: I am zooming from a session(A) to another session(B). In (B) I enter records and save. When I return to the main session (A) I want the sum of a field to be displayed in (A). To do this I have selected the table for session (B), read the corresponding records (like order header + lines would be linked), I total the field and I try to do a db.update and a commit.
I have read the other threads on this in the forums, but still a bit confused. I understand the problem is to do with commit interfering with standard code, but if I remove the commit I get the message "Transaction isn't on". I have placed my code below.
Could someone have a look at it and give me some advise???
Not sure how I could use after.update.db.commit???
Thanks for any help offered, very much appreaciated!!
after.zoom:
|*** returning the total downtime hours
temptotal = 0
temptotal2 = 0
wawti601.dthrstot = 0
db.retry.point()
select wawti611.*, wawti601.*
from wawti611, wawti601 for update
where wawti611.pono = :wawti601.pono
and wawti601.pono = :wawti601.pono
selectdo
temptotal = temptotal + wawti611.dthrsact
temptotal2 = temptotal2 + wawti611.changeov + wawti611.startup +
wawti611.nomat + wawti611.noop + wawti611.adjustmt + wawti611.projects
selecteos
wawti601.dthrstot = temptotal + temptotal2
wawti601.pdvolact = temp1
wawti601.overwgt = temp2
db.update(twawti601, DB.RETRY)
commit.transaction()
endselect
I have a problem with Error 206, Record is not locked.
I will try to explain what I am doing: I am zooming from a session(A) to another session(B). In (B) I enter records and save. When I return to the main session (A) I want the sum of a field to be displayed in (A). To do this I have selected the table for session (B), read the corresponding records (like order header + lines would be linked), I total the field and I try to do a db.update and a commit.
I have read the other threads on this in the forums, but still a bit confused. I understand the problem is to do with commit interfering with standard code, but if I remove the commit I get the message "Transaction isn't on". I have placed my code below.
Could someone have a look at it and give me some advise???
Not sure how I could use after.update.db.commit???
Thanks for any help offered, very much appreaciated!!
after.zoom:
|*** returning the total downtime hours
temptotal = 0
temptotal2 = 0
wawti601.dthrstot = 0
db.retry.point()
select wawti611.*, wawti601.*
from wawti611, wawti601 for update
where wawti611.pono = :wawti601.pono
and wawti601.pono = :wawti601.pono
selectdo
temptotal = temptotal + wawti611.dthrsact
temptotal2 = temptotal2 + wawti611.changeov + wawti611.startup +
wawti611.nomat + wawti611.noop + wawti611.adjustmt + wawti611.projects
selecteos
wawti601.dthrstot = temptotal + temptotal2
wawti601.pdvolact = temp1
wawti601.overwgt = temp2
db.update(twawti601, DB.RETRY)
commit.transaction()
endselect