Hi People, first of all I would like to thank You for Your help.
I got a solution for my Problem.
I first wrote a find method for my table, in which I can identify one record with my PK (SycAccountNum) .
----------------------------------------------------------------------------------------------------------------------
public static SycStagingTable find(SycAccountNum_WEB _webaccount, boolean _update = false)
{
SycStagingTable stagingtable;
;
stagingtable.selectForUpdate(_update);
if (_webaccount)
{
select firstOnly stagingtable
where stagingtable.AccountNum_WEB == _webaccount;
}
return stagingtable;
}
----------------------------------------------------------------------------------------------------------------------
And then in my doForEach Method I added this
private void doForEach(container _record)
{
SycStagingTable stagingtable;
SycAccountNum_WEB accountnumweb;
;
accountnumweb = conPeek(_record,4);
stagingtable = SycStagingTable::find(accountnumweb, true);
stagingtable.LastName = conPeek(_record,1); //first Column
stagingtable.FirstName = conPeek(_record,2); //second Column
stagingtable.AccountNum = conPeek(_record,3); //third Column
stagingtable.AccountNum_WEB = conPeek(_record,4);
stagingtable.AddressStreet = conPeek(_record,5);
stagingtable.Housenumber = conPeek(_record,6);
stagingtable.AddressZipCodeId = conPeek(_record,7);
stagingtable.AddressCity = conPeek(_record,8);
stagingtable.AddressCountryRegionId = conPeek(_record,9);
stagingtable.Email = conPeek(_record,10);
stagingtable.Phone = conPeek(_record,11);
stagingtable.CustGroupId = conPeek(_record,12);
if (stagingtable.validateWrite())
{
stagingtable.write();
}
else
{
throw error("@RET2939");
}
}