Subject RE: [IBO] Re: Creating a Stored Procedure at runtime
Author Gerhardus Geldenhuis
Hi
I tried it but there does not exist a ParamNames property.
I could also not find anything that looked like it would
add a parameter.

Groete
Gerhardus

>
> Gerhardus,
>
> try:
> SourceSP.Params.ParamNames.Add('IN_UID');
> before you prepare and call
> SourceSP.Params.ParamByName('IN_UID').AsString:=UID;
>
> I think, this should work.
>
> Regards
> Richard
>
> --- In IBObjects@y..., "Gerhardus Geldenhuis" <flooder@g...> wrote:
> > Hi
> > I am trying to run a stored procedure at runtime but am
> > not succesfull. I cant seem to set the parameters.
> > I have a feeling I am missing something obvious.
> > The lines between the question marks is the combinations
> > that I have tried.
> >
> > try
> > SourceSP:=TIB_StoredProc.Create(DMRep);
> > SourceSP.IB_Connection:=SourceConnetion;
> > SourceSP.IB_Transaction:=SourceTransaction;
> > // SourceSP.AutoDefineParams:=true;//has no effect
> > SourceSP.StoredProcName:='Read_Log_'+SPName;
> > //?????????
> > SourceSP.Params.ParamByName('IN_UID').AsString:=UID;//fieldname
> in_uid
> > not fournd
> > sourcesp.ParamByName('in_uid').asstring:=uid;//parameter
> mismatch
> > sourcesp.Params.SetColumnValue('IN_UID',UID);//parameter
> mismatch
> > //?????????
> > SourceSP.Prepared:=True;
> > SourceSp.ExecProc;
> > finally
> > SourceSP.Free;
> > end;//try finally