Subject | help |
---|---|
Author | andy susanto |
Post date | 2003-01-30T09:47:58Z |
i am beginner,
i try to create procedure with my Delphi Program.This is my part of my code
:
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 '+
' JenisTransaksi = ''S'' into :QuantitySales; '+
' Quantity = QuantityPurchase - QuantitySales; '+
' Suspend; '+
' end '+
'END');
IBSQL.ExecQuery;
when that SQL Statement Execute, my Delphi Program Raise an Excepction:
"Dynamic SQL Error SQL error code = -104 Token unknown -line 1,char 266 ?"
TIA,
andy
i try to create procedure with my Delphi Program.This is my part of my code
:
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 '+
' JenisTransaksi = ''S'' into :QuantitySales; '+
' Quantity = QuantityPurchase - QuantitySales; '+
' Suspend; '+
' end '+
'END');
IBSQL.ExecQuery;
when that SQL Statement Execute, my Delphi Program Raise an Excepction:
"Dynamic SQL Error SQL error code = -104 Token unknown -line 1,char 266 ?"
TIA,
andy