Subject Re: [IBO] 4.9.14b32 - Problem with executable SP and output parameters
Author Thomas Steinmaurer
Jason,

> You said:
> I'm not talking about executing the procedure as SELECT * FROM<SP> at
> the client side but rather some kind of EXECUTE PROCEDURE ...
> RETURNING_VALUES ... equivalent? I don't know the IBO internals, e.g.
> what client API call TIB_StoredProc.ExecProc is issuing.
>
> Adding SUSPEND to a SP which is then used as EXECUTE PROCEDURE ... has
> been treated as devil already in the old InterBase days. I'm just
> seeking for the reason why the most recent IBO version behaves
> differently in that area with the same Firebird engine version.
>
> Or possibly I simply don't understand the problem in its full potential. ;-)
>
> My reply:
> You are correct that I did not discuss using the statement EXECUTE PROCEDURE
> ... RETURNING_VALUES ... at all in those issues. I understand why you would
> not be satisfied and agree you shouldn't be.
>
> I don't have an answer at this time but I will look into this tomorrow when
> my mind is more fresh. You should be able to simply drop an EXECUTE
> PROCEDURE ... statement into an IB_DSQL component and call ExecSQL and then
> grab your output values in its Fields column list. If this doesn't work then
> it is possible I could have done something to break it that I need to look
> into. Perhaps between now and then you can test some things out and report
> back to me your findings.

Tried the following:

procedure TForm1.Button1Click(Sender: TObject);
begin
if not IB_Connection1.Connected then
IB_Connection1.Connect;
IB_StoredProc1.ExecProc;
ShowMessage(IntToStr(IB_StoredProc1.FieldByName('RINT').AsInteger));
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if not IB_Connection1.Connected then
IB_Connection1.Connect;
IB_DSQL1.Execute;
ShowMessage(IntToStr(IB_DSQL1.FieldByName('RINT').AsInteger));
end;


The same SP, simply returning 1 in an output parameter RINT.

While I don't get the expected result in the Button1Click event using a
TIB_StoredProc, it works in the second example using an EXECUTE
PROCEDURE P1 statement in in TIB_DSQL.


Regards,
Thomas