Subject | RE: [ib-support] help |
---|---|
Author | Bill Meaney |
Post date | 2003-01-30T13:58:06Z |
You are missing an AND in the where clause. See below.
+ missing
Bill Meaney
>^^^
> 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; '+HTH
> ' Suspend; '+
> ' end '+
> 'END');
> IBSQL.ExecQuery;
>
Bill Meaney