stored proc Output parameter in Firebird lazarus / 16-Databases ---------------------------------------------------------------------- motaz · 2010-02-27 08:55 Hello I get a NULL value in the output paramter (C) when calling this FireBird procedure: Code: [Select]ALTER PROCEDURE SUMMATION (     A Integer,     B Integer ) RETURNS (     C Integer ) AS BEGIN   C = A + B; END^ I'm using Zeos library to connect to Firebird 2.1: Code: [Select]  ZStoredProc1.Params.Clear;   ZStoredProc1.Params.Add;   ZStoredProc1.Params[0].ParamType:= ptInput;   ZStoredProc1.Params[0].DataType:= ftInteger;   ZStoredProc1.Params[0].Name:= 'A';   ZStoredProc1.Params.Add;   ZStoredProc1.Params[1].ParamType:= ptInput;   ZStoredProc1.Params[1].DataType:= ftInteger;   ZStoredProc1.Params[1].Name:= 'B';   ZStoredProc1.Params.Add;   ZStoredProc1.Params[2].ParamType:= ptOutput;   ZStoredProc1.Params[2].DataType:= ftInteger;   ZStoredProc1.Params[2].Name:= 'C';   ZStoredProc1.ParamByName('A').AsInteger:= 1;   ZStoredProc1.ParamByName('B').AsInteger:= 2;   ZStoredProc1.ExecSQL;   ShowMessage(ZStoredProc1.ParamByName('C').AsString); I'm using Lazarus 0.9.28.2 on Ubuntu thanks ---------------------------------------------------------------------- fredycc · 2010-02-27 13:17 Hello motaz; test it: create or alter procedure SUMMATION (     A integer,     B integer) returns (     C integer) as begin   C = A + B;   suspend; end^ You need suspend for retun a value. ---------------------------------------------------------------------- JD · 2010-02-27 20:33 Results of stored procedures are passed back to the calling program by the 'suspend' command. Inserting 'suspend' on the line before 'end' will solve the problem. ---------------------------------------------------------------------- motaz · 2010-02-28 08:34 Yes, the problem solved, thatnks but instead of calling the procedure by .ExecSql I use .Open to execute and get the result