Subject Re: [IBO] Re: Problems with parameters in subquery
Author Martijn Tonies
> > > I have a query which contains a subquery. Subquery receives 2 date
> > > parameters, the problem is that when the query is activated,
> > > application raises an exception class EConvertError: "01/01/2006 is
> > > not a valid INTEGER value".
> > > I don't now why it's an integer value if I'm sending the parameter
> > > like a date value. If I execute the same query in ISQL there is no
> > > problem.
> > > Any suggestion?
> >
> > Yes. Send queries and metadata. Mind you: this is a Delphi-side
> > error, so make sure if the (parameter) types are correct.
> >
> This is my query:
> "Select CFFolEst, CFNumeroEst as Pregunta, CFIdUsu, CFFECHORA,
> CFDescCat as Tipo, CFTipoEst, CFValor,
> (Select Count(CFFolEst) From TFTExamen, TFCHorExamen
> Where TFTExamen.CFFolEst = TFEEstacion.CFFolEst
> and TFTExamen.CFFolioEx = TFCHorExamen.CFFolioEx
> and TFCHorExamen.CFFecha between :FecIni and :FecFin) as Total
> >From TFEEstacion, TFCGlobalCat
> Where TFEEstacion.CFTipoEst = TFCGloBalCat.CFCodCat
> and CFCodTema =:Codigo
> Group by CFFolEst, CFNumeroEst, CFIdUsu, CFFecHora, CFDescCat,
> CFTipoEst, CFValor"
>
> Metadata:
> TFCHorExamen.CFFecha DATE not null
> CFCodTema INTEGER not null
>
> This is the Delphi code for retrieving data from the query:
> IBOQuery1.ParamByName('FecIni').asDate := StrToDate('01/01/2005');
> IBOQuery1.ParamByName('FecFin').asDate := StrToDate('03/01/2005');
> IBOQuery1.ParamByName('Codigo').Value := 98;
> IBOQuery1.Active := True;
>
> I already checked the types and they're correct. So, I don't know
> what's the problem. Maybe my Delphi code...

Does this error happen during design time or runtime? Have you tried both?

From what I can see, this is an excellent case of detecting the wrong param
datatype due to an old Firebird error.

What version of IBO are you using?

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com