Subject Re: [IBO] Error with parameters
Author Carlos H. Cantu
What happens if you prepare the query before assigning the parameter
value?

Afair, with TIBO components there is no need to prepare before
opening, but with TIB_ components, you need to prepare.

[]s
Carlos H. Cantu
www.FireBase.com.br - www.firebirdnews.org
www.warmboot.com.br - blog.firebase.com.br

SL> Andrei,

>> Today I installed the newest IBO version, and now I'm getting an error
>> in the following code:
>>
>> Procedure CalculaTotal;Var qry_tmp : TIB_Query;Begin  qry_tmp :=
>> TIB_query.Create(Self);  qry_tmp.DatabaseName :=
>> dm.cnSistema.DatabaseName;  qry_tmp.SQL.Text := 'Select
>> Coalesce(sum((qtde  - estorno) *valor), 0) as totPedido, '+
>>                    ' Coalesce(sum((qtde  - estorno) *
>> valor_compra_original), 0) as totCompraPedido, '+
>>          ' Coalesce(sum((qtde  - estorno) * valor_lista), 0) as
>> totPedidoLista '+                               'from pedidosItens
>> where orcamento_id = :worc_id group by orcamento_id';
>> qry_tmp.ParamByName('worc_id').asInteger
>> :=dm.qrOrcamentos.FieldByName('Registro_id').AsInteger;
>> qry_tmp.Open;end;
>> The error is 'Project project1.exe raised exception class
>> EIB_StatementError with message 'Field: worc_id not found'.
>> If I open the query before I feed the parameter, the error doesn´t
>> occur. But this seems that I need to search in all my systems, and
>> change several code lines.
>>
>> - Since which version this behavior was implanted?