SQLdb Execute procedure in Firebird lazarus / 16-Databases ---------------------------------------------------------------------- wiesiek · 2007-04-04 08:36 I have --- SP in Firebird SET TERM ^ ; CREATE PROCEDURE UNI_VAL RETURNS (u_id INTEGER) AS BEGIN     u_id = GEN_ID(gen_uni_val,1); END ^ SET TERM ; ^ --- procedure in Lazarus procedure TForm1.Button2Click(Sender: TObject); begin   SQLQuery2.SQL.Text := 'EXECUTE PROCEDURE UNI_VAL';   SQLQuery2.ExecSQL;   //   //    ???     where is a ret val   ???   // end; ---------------------------------------------------------------------- jesusr · 2007-04-05 05:51 It seems it lacks the command SUSPEND; before the END^. AFAIK It's at that moment when values are transfered I'm not sure if it works without it though, I always have it if stored procedure returns values. Then to the get the value you do something like: Code: [Select] SQLQuery2.Close; SQLQuery2.Sql.Text:='SELECT U_ID from UNI_VAL'; SQLQuery2.Open; // TheValue:=SQLQuery2.Fields[0].ASInteger; HTH. ---------------------------------------------------------------------- wiesiek · 2007-04-05 07:34 Very Thanks. :-)