ltannous
10th October 2002, 22:52
I am writing an update script for a session that will update the sales price in the sales contracts with the standard cost price from item data.
This seems to work when I select only one item at a time.
How can I update a range of items when I select a range of items.
This is what I have so far:
functions:
function read.main.table()
{
long count
db.retry.point()
select tdssc001.*
from tdssc001 for update
where tdssc001._index3 inrange {:item.f, :cuno.f, :cdel.f , :cont.f, :pono.f}
and {:item.t, :cuno.t, :cdel.t,:pono.t}
order by tdssc001._index3
selectdo
refresh()
select tiitm001.copr
from tiitm001
where tiitm001.item inrange :item.f and :item.t
selectdo
itmpric = tiitm001.copr
|update set
tdssc001.pric = itmpric
db.update(ttdsc001, db.retry)
count = count + 1
if count > 50 then
count = 0
commit.transaction()
endif
endselect
endselect
commit.transaction
refresh()
}
:mad:
This seems to work when I select only one item at a time.
How can I update a range of items when I select a range of items.
This is what I have so far:
functions:
function read.main.table()
{
long count
db.retry.point()
select tdssc001.*
from tdssc001 for update
where tdssc001._index3 inrange {:item.f, :cuno.f, :cdel.f , :cont.f, :pono.f}
and {:item.t, :cuno.t, :cdel.t,:pono.t}
order by tdssc001._index3
selectdo
refresh()
select tiitm001.copr
from tiitm001
where tiitm001.item inrange :item.f and :item.t
selectdo
itmpric = tiitm001.copr
|update set
tdssc001.pric = itmpric
db.update(ttdsc001, db.retry)
count = count + 1
if count > 50 then
count = 0
commit.transaction()
endif
endselect
endselect
commit.transaction
refresh()
}
:mad: