Subject RE: [ib-support] help
Author Bill Meaney
You are missing an AND in the where clause. See below.
>
> IBSQL.SQL.Clear;
> IBSQL.SQL.Add('CREATE PROCEDURE ITEMLIST '+
> 'RETURNS(ITEMNO VARCHAR(60),ITEMDESCRIPTION VARCHAR(100),QUANTITY
>NUMERIC(15,2)) '+
> 'AS '+
> ' Declare Variable QuantityPurchase Numeric(15,2); '+
> ' Declare Variable QuantitySales Numeric(15,2); ' +
> 'BEGIN '+
> ' for Select ItemNo,ItemDescription from Item into :ItemNo,
>:ItemDescription do '+
> ' begin '+
> ' Select Quantity from ItemHist where ItemNo = :ItemNo '+
> ' and JenisTransaksi = ''P'' into :QuantityPurchase; '+
> ' Select Quantity from ItemHist where ItemNo = :ItemNo '+


> ' AND JenisTransaksi = ''S'' into :QuantitySales; '+
^^^
+ missing



> ' Quantity = QuantityPurchase - QuantitySales; '+
> ' Suspend; '+
> ' end '+
> 'END');
> IBSQL.ExecQuery;
>



HTH
Bill Meaney