Subject | Re: [IBO] TIBOStored procedure returning no fields |
---|---|
Author | Helen Borrie |
Post date | 2001-10-20T01:58:01Z |
At 02:32 PM 20-10-01 +1200, James Low wrote:
Because the Params are not created at design time, you may still find that you need add a line after the Prepare to tell Delphi that the parameter is ptOutput.
You don't actually need a function like this in IBO. You can call the Gen_ID(GeneratorName, Increment) method of the TIBODatabase to get the next value of any generator.
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>...try as I may I cannot get the TIBOSToredProc component toTIBOStoredProc emulates TStoredProc so it returns output parameters to the Params[] array, not Fields[].
>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.
Because the Params are not created at design time, you may still find that you need add a line after the Prepare to tell Delphi that the parameter is ptOutput.
You don't actually need a function like this in IBO. You can call the Gen_ID(GeneratorName, Increment) method of the TIBODatabase to get the next value of any generator.
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________