updating n number of records mysql database I want to update n number of records in table using a query like below, but it will return an error since in mysql, it is not allowed to use value after the limit key
update producedItem pi 
inner join productionOrderLine pol on pol.id = pi.productionOrderLineId
set pi.isReserved = 1
limit floor(pol.quantity - pol.availableQuantity);

what would be the better alternative?
Write a Stored Procedure that 'constructs' the query, specifically by putting a computed value after LIMIT.