Subject | Stored Procedure Bug ? |
---|---|
Author | Gerhardus Geldenhuis |
Post date | 2001-09-05T14:00:33Z |
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.
Groete
Gerhardus
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.
Groete
Gerhardus