Subject [IBO] To Carlos Cantu Re: Problem com IBOQuery.Parambyname
Author dallagnelo
Estou migrando o sistema atual BDE para os componentes IBO
(IBODATASET). Estou ficando preocupado pois tem algumas telas que
estão mais lenta do que o atual. Estou tentando passar parâmetros
mais ocorre o erro:
DYNAMIC SQL ERROR
SQL ERROR CODE = -104
, sendo que com os componetes do BDE funciona e validei o SQL no
ibexpert. Com o IBO tem que fazer alguma outra coisa para passar
parâmetros? Segue o código abaixo.

IBOQUERY.CLOSE;
IBOQUERY.SQL.CLEAR;
IBOQUERY.SQL.ADD('SELECT');
IBOQUERY.SQL.ADD('1');
IBOQUERY.SQL.ADD('2');
IBOQUERY.SQL.ADD('3');
IBOQUERY.SQL.ADD('4');
IBOQUERY.SQL.ADD('WHERE');

IBOQUERY.SQL.ADD('A.DT_RECL between :DT_RECL1 and :DT_RECL2 ');
IBOQUERY.SQL.ADD('AND');
IBOQUERY.ParamByname('DT_RECL1').AsDateTime := eddata1.date;
IBOQUERY.ParamByname('DT_RECL2').AsDateTime := eddata2.date;

IBOQUERY.SQL.ADD('((A.Nr_OS = :NR_OS) OR (A.NR_LGI = :NR_OS)) ');
IBOQUERY.SQL.ADD('AND');
IBOQUERY.ParamByname('NR_OS').Text := edNR_OS.text;

IBOQUERY.SQL.DELETE(IBOQUERY.SQL.COUNT-1);

IBOQUERY.Close;
IBOQUERY.SQL.Strings[0] := 'SELECT A.NR_OS, A.CD_CONMUL, ';
IBOQUERY.SQL.Strings[1] := 'FROM TAB_OS A ';
IBOQUERY.SQL.Strings[2] := '';
IBOQUERY.SQL.Strings[3] := '';
IBOQUERY.SQL.Strings[4] := '';
IBOQUERY.SQL.Strings[5] := 'WHERE';
IBOQUERY.SQL.ADD('ORDER BY A.DT_RECL');
IBOQUERY.open;


--- In IBObjects@yahoogroups.com, "Carlos H. Cantu" <listas@w...>
wrote:
> Queira postar sua dúvida em português na lista da FireBase, assim
fica
> mais fácil te ajudar. Vc pode se cadastrar na lista fazendo o
cadastro
> no site em www.firebase.com.br
>
> []s
> Cantu
> http://www.warmboot.com.br
> FireBase - http://www.FireBase.com.br
>
>
> HB> Carlos Cantu, do you want to take care of this question?
>
> HB> thks
> HB> Helen
>
> HB> At 12:02 PM 6/01/2005 +0000, dallagnello wrote:
>
>
> >>I am migrando of BDE for IBO. very I am worried, therefore it has
> >>places that the systems are being slower of the one than was. I
> >>modified the component query for IBOQuery. When trying to pass
> >>parameter occurs the error of DYNAMIC SQL ERROR SQL ERROR CODE = -
> >>104, SQL was válidado in ibexpert and is correct. It follows
> >>below
> >>the code source:
> >>
> >> IBOQUERY.CLOSE;
> >> IBOQUERY.SQL.CLEAR;
> >> IBOQUERY.SQL.ADD('SELECT');
> >> IBOQUERY.SQL.ADD('1');
> >> IBOQUERY.SQL.ADD('2');
> >> IBOQUERY.SQL.ADD('3');
> >> IBOQUERY.SQL.ADD('4');
> >> IBOQUERY.SQL.ADD('WHERE');
> >>
> >> IBOQUERY.SQL.ADD('A.DT_RECL between :DT_RECL1 and :DT_RECL2 ');
> >> IBOQUERY.SQL.ADD('AND');
> >> IBOQUERY.ParamByname('DT_RECL1').AsDateTime := eddata1.date;
> >> IBOQUERY.ParamByname('DT_RECL2').AsDateTime := eddata2.date;
> >>
> >> IBOQUERY.SQL.ADD('((A.Nr_OS = :NR_OS) OR (A.NR_LGI
= :NR_OS)) ');
> >> IBOQUERY.SQL.ADD('AND');
> >> IBOQUERY.ParamByname('NR_OS').Text := edNR_OS.text;
> >>
> >> IBOQUERY.Close;
> >> IBOQUERY.SQL.Strings[0] := 'SELECT A.NR_OS, A.CD_CONMUL, ';
> >> IBOQUERY.SQL.Strings[1] := 'FROM TAB_OS A ';
> >> IBOQUERY.SQL.Strings[2] := '';
> >> IBOQUERY.SQL.Strings[3] := '';
> >> IBOQUERY.SQL.Strings[4] := '';
> >> IBOQUERY.SQL.Strings[5] := 'WHERE';
> >> IBOQUERY.SQL.ADD('ORDER BY A.DT_RECL');
> >> IBOQUERY.open;