ltannous
27th February 2004, 21:24
I have created a table similar to tdpur041 (purchase order lines)
I have an index on orer number and postion number.
I want to update my table with information from the purchase order lines.
When I execute the session, it only writes the last postion number, another error is that there has to be data in the record in order for me to update it.
Any suggestions:
form.all:
init.form:
get.screen.defaults()
zoom.from.all:
on.entry:
import("wtpur041.orno", hold.orno)
wtpur041.orno = hold.orno
choice.cont.process:
on.choice:
read.main.table()
functions:
function read.main.table()
{
long count
db.retry.point()
select tdpur041.*
from tdpur041
where tdpur041.orno = :hold.orno
selectdo
select wtpur041.*
from wtpur041 for update
where wtpur041.orno = :tdpur041.orno
order by wtpur041.orno
selectdo
|update set
display("wtpur041.orno")
refresh()
wtpur041.pono = tdpur041.pono
wtpur041.item = tdpur041.item
wtpur041.dim4 = tdpur041.dim4
db.update(twtpur041,db.retry)
count = count + 1
if count > 50 then
count = 0
endif
commit.transaction()
endselect
commit.transaction()
endselect
message("Session Completed")
exit()
}
I have an index on orer number and postion number.
I want to update my table with information from the purchase order lines.
When I execute the session, it only writes the last postion number, another error is that there has to be data in the record in order for me to update it.
Any suggestions:
form.all:
init.form:
get.screen.defaults()
zoom.from.all:
on.entry:
import("wtpur041.orno", hold.orno)
wtpur041.orno = hold.orno
choice.cont.process:
on.choice:
read.main.table()
functions:
function read.main.table()
{
long count
db.retry.point()
select tdpur041.*
from tdpur041
where tdpur041.orno = :hold.orno
selectdo
select wtpur041.*
from wtpur041 for update
where wtpur041.orno = :tdpur041.orno
order by wtpur041.orno
selectdo
|update set
display("wtpur041.orno")
refresh()
wtpur041.pono = tdpur041.pono
wtpur041.item = tdpur041.item
wtpur041.dim4 = tdpur041.dim4
db.update(twtpur041,db.retry)
count = count + 1
if count > 50 then
count = 0
endif
commit.transaction()
endselect
commit.transaction()
endselect
message("Session Completed")
exit()
}