Subject RE: [IBO] Re: Creating a Stored Procedure at runtime
Author Gerhardus Geldenhuis
Hi
Thanks for all the help I finally got it right.
Here is the succesfull piece of code:
var
I: Integer;
s:string;
begin
try
SourceSP:=TIB_StoredProc.Create(DMRep);
SourceSP.IB_Connection:=SourceConnetion;
SourceSP.IB_Transaction:=SourceTransaction;
SourceSP.StoredProcName:='Read_Rep_Log_'+SPName;
SourceSP.Prepared:=True;
SourceSP.Params[0].AsString:=UID;
SourceSP.ExecProc;
showmessage(inttostr(SourceSP.Fields.ColumnCount));
finally
SourceSP.Free;
end;//try finally

Groete
Gerhardus

>
> At 09:51 AM 04-12-01 +0000, you wrote:
> >Helen,
> >
> >I got error messages "Can't prepare..." from TIB_StoredProc with
> >StoredProcForSelect = True, when I haven't assigned ParamNames (if
> >any). So I always assign ParamNames for all
> >TIB_StoredProc "ForSelect" and it works fine. Am I missing anything?
>
> No, it is right to do it; but not as the poster was doing,
> assigning ParamNames and trying to apply values to the Params
> without Preparing....because the component can not know what
> kinds and types of params they are....
>
> regards,
> Helen