Лучше сделать внешним циклом запрос по purchLine
PHP код:
while select sum(OR_InvoiceQty) from purchLine
group by ItemId, OR_License, PurchPrice
where purchLine.purchId == purchTable.purchId
{
update_recordset contractSpecification
setting QuotaDelivered = purchLine.OR_InvoiceQty
where contractSpecification.ItemId == purchLine.ItemId
&& contractSpecification.Licence == purchLine.OR_License
&& contractSpecification.CIP == purchLine.PurchPrice;
}