Subject | StoredProc Error |
---|---|
Author | Gary Kind |
Post date | 2002-03-15T14:42:04Z |
Hi
I have just started using IBObjects and have a problem running a stored
proc.
I have a proc defined in the database as so
create procedure nextidaddress
returns (NEXTID integer)
as
begin
NextID = GEN_ID(AddressGen, 1);
suspend;
exit;
end
which runs fine. Im trying to call it through code by issuing -
FStoredProc.IB_Connection := FDataTarget;
FStoredProc.StoredProcName := AProcName;
FStoredProc.ParamNames.Clear;
FStoredProc.Prepare;
FStoredProc.ExecProc;
Result := FStoredProc.FieldByName('NEXTID').AsInteger;
FStoredProc.Unprepare;
FStoredProc.IB_Transaction.Commit;
But when I do I keep getting 'Invalid Transaction handle (expecting explicit
transaction start)' at the Prepare statement which I thought was because I
havent issued an FStoreProc.StartTransaction, even if I add this line of
code
I still get the error. Can anyone help?
Many Thanks
Gary
I have just started using IBObjects and have a problem running a stored
proc.
I have a proc defined in the database as so
create procedure nextidaddress
returns (NEXTID integer)
as
begin
NextID = GEN_ID(AddressGen, 1);
suspend;
exit;
end
which runs fine. Im trying to call it through code by issuing -
FStoredProc.IB_Connection := FDataTarget;
FStoredProc.StoredProcName := AProcName;
FStoredProc.ParamNames.Clear;
FStoredProc.Prepare;
FStoredProc.ExecProc;
Result := FStoredProc.FieldByName('NEXTID').AsInteger;
FStoredProc.Unprepare;
FStoredProc.IB_Transaction.Commit;
But when I do I keep getting 'Invalid Transaction handle (expecting explicit
transaction start)' at the Prepare statement which I thought was because I
havent issued an FStoreProc.StartTransaction, even if I add this line of
code
I still get the error. Can anyone help?
Many Thanks
Gary