I hope you do not mind these newbie questions!
I have set a relationship up between two tables,- one to many
But I am having trouble with the replace - it only replaces the first records in the tempitems table, but there is lots of records. How can I get it to replace all the related records in tempitems and not just the first records.
I am not sure how i change the scan to cope with this ?
Many thanks in advance
SET RELATION TO ID INTO tempitems
lnnewpk=loMain.createnewID()
lnitemID=loItems.createnewID()
SELECT tempmain
SCAN
REPLACE tempmain.pk WITH lnnewpk
REPLACE tempitems.main_fk WITH lnnewpk
REPLACE tempitems.pk WITH lnitemID
lnnewpk=loDev.createnewID()
lnitemID=loDev1.createnewID()
ENDSCAN
I have set a relationship up between two tables,- one to many
But I am having trouble with the replace - it only replaces the first records in the tempitems table, but there is lots of records. How can I get it to replace all the related records in tempitems and not just the first records.
I am not sure how i change the scan to cope with this ?
Many thanks in advance
SET RELATION TO ID INTO tempitems
lnnewpk=loMain.createnewID()
lnitemID=loItems.createnewID()
SELECT tempmain
SCAN
REPLACE tempmain.pk WITH lnnewpk
REPLACE tempitems.main_fk WITH lnnewpk
REPLACE tempitems.pk WITH lnitemID
lnnewpk=loDev.createnewID()
lnitemID=loDev1.createnewID()
ENDSCAN