Subject TIBOStored procedure returning no fields
Author James
I am sure this is simple, but have toiled trying to find a solution ... and searched.


My IB5 DB has the following stored proc (created like this):

CREATE PROCEDURE PRO_GETSLPRTY
RETURNS (ID_SLPRTY INTEGER)
AS
BEGIN
ID_SLPRTY = gen_id(GEN_SLPRTY, 1);
END $
COMMIT$

It returns the next ID for the table. It works fine in WISQL (ie I get 3, 4, 5
successive calls), but try as I may I cannot get the TIBOSToredProc component to
execute it and return the result. I am using TIBODatabase (active in Design and at
runtime), dialect 1, and all the default settings for this component. MY stored proc
is executed as follows (it exists on a datamodule):

with StoredProc do begin

StoredProcName := SPPREFIX + Tablename; //This is correct.
try
Prepare;
Execproc;
Result := StoredProc.Fields[0].AsInteger;
finally
//nothing to do here at this stage
end;
end;

What am I missing ... I get a list out of bounds (ie there are no fields returned)when
I run, and "Error creating cursor handle" if I try to make the StoredProc
active at design time (probably silly to try). The storedProc has databasename set
correctly.

Sorry if this is blaringly obvious - TIA.

James Low


__________________________________________________
Advertise with ZFREE - to find out more click below
http://www.zfree.co.nz/about-us/advert.html