Page 1 of 1

Getting value from stored FB procedure

Posted: Tue 25 Sep 2012 11:21
by toneskok
Hi,

I have simple sp in FB that returns only one value. There is no suspend command in sp.
I'm using last version of Unidac controls.
Now I'm trying to get that returned value in Delphi app with TUniQuery.
In code I do:

Code: Select all

q.Clear;
q.SQL.Add('EXECUTE PROCEDURE TESTME(1)');
q.ExecSql;
Returned value is not in FieldByName collection, since this is execute statement, but it should be in ParamByName collection.

I also tried with

Code: Select all

q.Clear;
q.SQL.Add('EXECUTE PROCEDURE TESTME(1) RETURNING_VALUE :RET');
q.Prepare;
q.ExecSql;
But that also doesn't work.
I don't want to use TUniStoredProc component.

Any suggestions?

Regards, Tone

Re: Getting value from stored FB procedure

Posted: Tue 25 Sep 2012 11:58
by AndreyZ
Hello,

You should use the following code:

Code: Select all

q.Clear;
q.CreateProcCall('TESTME');
q.ExecSql;
For more information about the CreateProcCall method, please refer to the UniDAC documentation.

Re: Getting value from stored FB procedure

Posted: Tue 25 Sep 2012 12:14
by toneskok
That worked like charm.

Thank you.

Regards, Tone

Re: Getting value from stored FB procedure

Posted: Tue 25 Sep 2012 12:18
by AndreyZ
If any other questions come up, please contact us.