Stored Procedure Output parameter
Posted: 08.11.2010, 08:05
How do I get a resultant parameter from a stored procedure:
CREATE PROCEDURE PROC_DO_ICD
(INID_FLT T_IDENTITY
,INTY_ICD TY_SRC
,INID_ICD_TO T_IDENTITY
,INDE_DO_ICD T_DESCRIPTIONSHORT )
RETURNS
( OUTID_ICD_TO T_IDENTITY )
calling the below statement
EXECUTE PROCEDURE MY_PROC_DO_ICD 2, 2,0,"Invoice" RETURNING_VALUES :THERETURN
by
prm := qry.ParamByName('THERETURN');
prm.ParamType := ptOutput;
prm.DataType := ftInteger;
try
qry.ExecSQL;
except
on E : Exception do
giveup;
end;
Result := prm.AsInteger;
FreeAndNil(qry);
fails.
any ideas?
Kind Regards,
Robert.
:?:
CREATE PROCEDURE PROC_DO_ICD
(INID_FLT T_IDENTITY
,INTY_ICD TY_SRC
,INID_ICD_TO T_IDENTITY
,INDE_DO_ICD T_DESCRIPTIONSHORT )
RETURNS
( OUTID_ICD_TO T_IDENTITY )
calling the below statement
EXECUTE PROCEDURE MY_PROC_DO_ICD 2, 2,0,"Invoice" RETURNING_VALUES :THERETURN
by
prm := qry.ParamByName('THERETURN');
prm.ParamType := ptOutput;
prm.DataType := ftInteger;
try
qry.ExecSQL;
except
on E : Exception do
giveup;
end;
Result := prm.AsInteger;
FreeAndNil(qry);
fails.
any ideas?
Kind Regards,
Robert.
:?: