Subject | RE: [IBO] 4.9.14b32 - Problem with executable SP and output parameters |
---|---|
Author | IBO Support List |
Post date | 2012-01-09T23:38:13Z |
Thomas,
Would you provide the SQL trace that the IBO trace monitor outputs so I can
decipher exactly what API calls are being used?
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Thomas Steinmaurer
Sent: 09 January 2012 02:33 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] 4.9.14b32 - Problem with executable SP and output
parameters
Jason,
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
Would you provide the SQL trace that the IBO trace monitor outputs so I can
decipher exactly what API calls are being used?
Thanks,
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of Thomas Steinmaurer
Sent: 09 January 2012 02:33 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] 4.9.14b32 - Problem with executable SP and output
parameters
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.
>PROCEDURE
> My reply:
> You are correct that I did not discuss using the statement EXECUTE
> ... RETURNING_VALUES ... at all in those issues. I understand why youwould
> not be satisfied and agree you shouldn't be.when
>
> I don't have an answer at this time but I will look into this tomorrow
> my mind is more fresh. You should be able to simply drop an EXECUTEthen
> PROCEDURE ... statement into an IB_DSQL component and call ExecSQL and
> grab your output values in its Fields column list. If this doesn't workthen
> it is possible I could have done something to break it that I need to lookTried the following:
> into. Perhaps between now and then you can test some things out and report
> back to me your findings.
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