Subject Re: [IBO] Stored Procedure Bug ?
Author Helen Borrie
At 04:00 PM 05-09-01 +0200, you wrote:
>Hi
>
>I am still using IBO 3.6 so perhaps the bug has been fixed.
>
>Here is a procedure of mine.
>
>function TCosting.Delete_BOM_Items(Instruction: String):Integer;
>begin
> Result:=0;
> with CostingDM do
> begin
> try
> IBOSP:=TIBOStoredProc.Create(CostingDM);
> IBOSP.DatabaseName:=IBOQBOM.DatabaseName;
> IBOSP.IB_Transaction:=IBOQBOM.IB_Transaction;
> IBOSP.StoredProcName:='DELETE_BOM_ITEMS';
> IBOSP.Prepared:=True;
> IBOSP.Params[0].AsInteger:=IBOQWorksOrder['WORKSORDERNO'];
> IBOSP.Params[1].AsString:=Instruction;
> IBOSP.ExecProc;
> if IBOSP.Params[0].ParamType=ptoutput//debug
> then showmessage('ptoutput');//debug
> Result:=IBOSP.Parambyname('OUT_COUNT').AsInteger;
> finally
> IBOSP.Free;
> end;//try finally
> IBOQBOM.Active:=False;
> IBOQBOM.Active:=True;
> end;//with do
>end;
>
>The problem is that when I try to access the output parameter with
>Params[0] I get the original input value. Also the paramtype never
>changes to ptOutput which explains why I get the value I get.
>Parambyname works fine however. Is this a bug or does it have to
>do with the way I prepare my procedure.

If you are using the TDataset components then check Params[2] !!

If the TIB_ native, then read the Fields[] array to get the return values, not Params[].

rgds,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________