Subject Execute block usage
Author Robert Martin
Hi

I want to run the following from an IBOQuery but get issues I guess are
related to the ; is that right? If so do I need to it as a script or
can I use it in a TIBOQuery?

execute block(sourceControlRef bigint = :ControlRef)
as
declare slRef int;
begin
FOR
SELECT sl2.StockLevelRef
FROM WorkRegionTransfer wrt
JOIN StockLevel sl2 ON sl2.ItemRef = wrt.ItemRef
LEFT JOIN StockTransferLine stl ON (stl.StocktfRef =
wrt.StockTfRef AND stl.ItemRef = wrt.ItemRef)
WHERE wrt.ControlRef = sourceControlRef
AND (stl.StocktfRef IS NULL OR stl.ReceivedQty IS NOT NULL)
INTO :slRef
DO
UPDATE StockLevel sl SET sl.Transferin = sl.Transferin
WHERE StocklevelRef = :slRef;
END
end


Thanks
Rob