Hi,
it is possible to use a ReturnParameter (from a Insert Statement with ...returning ...) in a StoredProcedure using TIBCSQL?
How can I do that to get the value in Delphi?
Return Parameter for StoredProcedure
-
AndreyZ
Re: Return Parameter for StoredProcedure
Hello,
You can use the following code:, where NEW_DEPT is the following stored procedure:, dept is the following table:, and gen_dept is a generator.
You can use the following code:
Code: Select all
begin
IBCSQL.CreateProcCall('new_dept');
IBCSQL.Execute;
ShowMessage(IBCSQL.ParamByName('deptno').AsString);
end;Code: Select all
create procedure new_dept
returns (
deptno integer)
as
begin
insert into dept(deptno) values(next value for gen_dept) returning deptno into :deptno;
endCode: Select all
create table dept (
deptno integer primary key,
dname varchar(14),
loc varchar(13)
);Re: Return Parameter for StoredProcedure
Thank you - that answers my question!
-
AndreyZ
Re: Return Parameter for StoredProcedure
I am glad to help. If any other questions come up, please contact us.