ltannous
14th October 2002, 04:49
I am trying to write an update session that selects the standard cost of an item from comapany A, and updates the purchase price in item data in company B. for a range of items.
This is what I have so far:
functions:
function read.main.table()
{
long count
db.retry.point()
select tiitm001.*
from tiitm001
where tiitm001._compnr = "A"
selectdo
tiitm001.item = itmA
tiitm001.copr = coprA
select tiitm001.*
from tiitm001
where tiitm001._index1 in range {:item.f}
and {:item.t}
and tiitm001._compnr = "B"
order by tiitm001._index1
selectdo
|update set
if tiitm001.item = itmA
then
tiitm001.prip = coprA
db.update(ttiitm001, db.retry)
count = count +1
if count > 50 then
count = 0
commit.transaction()
endif
endif
endselect
commit.transaction()
}
This is what I have so far:
functions:
function read.main.table()
{
long count
db.retry.point()
select tiitm001.*
from tiitm001
where tiitm001._compnr = "A"
selectdo
tiitm001.item = itmA
tiitm001.copr = coprA
select tiitm001.*
from tiitm001
where tiitm001._index1 in range {:item.f}
and {:item.t}
and tiitm001._compnr = "B"
order by tiitm001._index1
selectdo
|update set
if tiitm001.item = itmA
then
tiitm001.prip = coprA
db.update(ttiitm001, db.retry)
count = count +1
if count > 50 then
count = 0
commit.transaction()
endif
endif
endselect
commit.transaction()
}