How to retrieve results of stored procedure execution?
Posted: Tue 10 Apr 2012 12:59
I have in my database the following procedure:
and I'm migrating from ibx.
So until now I used to use tibstoredproc in the following way:
How should i access the storedprocedure results and return rkod_dost because the above code (of course with replaced execproc to execute) tells me that rkod_dost is unknown.
I'm looking forward to your help.
Regards
Pawel
Code: Select all
create or alter procedure ACCES_CTRL (
IUSER varchar(12),
IFORMA varchar(30),
IPROGRAM varchar(30))
returns (
RKOD_DOST smallint,
RFULLNAME varchar(66))
as
BEGIN
SELECT kod_dost, fullname
FROM USER_ACCES
WHERE (usymbol = :iuser) AND (forma = :iforma)
AND (program_name = :iprogram)
INTO :rkod_dost, :rfullname;
ENDSo until now I used to use tibstoredproc in the following way:
Code: Select all
with spActrl do
begin
if Admin then result:=99
else
begin
ParamByName('iUser').AsString := pUser;
ParamByName('iForma').AsString := pForma;
ParamByName('iProgram').AsString := Application.Title;
execproc;
Result := parambyname('RKOD_DOST').AsInteger;
end;
end;
end;I'm looking forward to your help.
Regards
Pawel