karlovac
18th October 2002, 11:28
In tdpur tables 040/041 we have purchase orders on which items has wrong item groups: field tdpur041.citg.

In tiitm we entered new groups for all items:
field tiitm001.citg

How to make update of tables ...
to change all purchase orders to have
in table field tdpur041.citg new groups we need.

Some concept is:

update tdpur041.citg as
select tiitm001.citg
where tdpur041.item = tiitm001.item

How to do it in Baan?
I see it is one-way relationship and this changes shouldn't cause any problem in other modules.!?
(correct me if I am wrong)

Thanks

Darren Phillips
18th October 2002, 12:31
You may have problems with finance module as the item group is used to create the relations between dimensions and accounts I would check with baan support before making such a change.

karlovac
18th October 2002, 13:18
Thanks, Darren,

I will ask, but if they that say this is not a problem,
what is suggestion for better way to do that?

Darren Phillips
18th October 2002, 14:00
db.retry.point()

select tdpur041.*, tiitm001.citg
from tdpur041 for update, tiitm001
where tdpur041.item refers to tiitm001
selectdo
tdpur041.citg = tiitm001.citg
db.update(ttdpur041, db.retry)
endselect
commit.transaction

have not tested it but something like this.

also remember to do your history tables if you want to keep things consistant

frigyesg
18th October 2002, 14:11
I would add the following to the where condition

...
and tdpur041.citg <> tiitm001.citg
...

This would increase the performance, because only the records needs to be updated, where is a difference between the item groups in tiitm001 and tdpur041.

karlovac
18th October 2002, 14:11
Thanks a lot