Subject Re: [IBO] what's wrong with this syntax ?
Author John vd Waeter
Syntax looks ok to me.

However, could it be that the size of the parameter may not exceed the
size of the field?

What happens if you change the size of id_dpt to accommodate the parameter?

Just a wild guess...

John


peppepolpo wrote:
> I am using IBO 4.8.7 .
>
> This syntax works:
>
> procedure TfrmMain.itmTestClick(Sender: TObject);
> var
> i:integer;
> s:string;
> begin
> with TIBOQuery.Create(self) do
> try
> databaseName:='cb4db';
> sql.text:=
> 'select * from tb_emp '+
> 'where id_dpt in (''e4f071bc-c4a7-11de-b899-00219bfd1931'',''5fc7684c-750b-11de-835d-001560c9703c'')';
> Open;
> i:=RecordCount; //i=3 CORRECT
> finally
> Free;
> end;
>
> end;
>
> this syntax does not work:
>
> procedure TfrmMain.itmTestClick(Sender: TObject);
> var
> i:integer;
> s:string;
> begin
> with TIBOQuery.Create(self) do
> try
> databaseName:='cb4db';
> sql.text:=
> 'select * from tb_emp '+
> 'where id_dpt in (:id_dpt)';
> Prepare;
> ParamByName('id_dpt').AsString:=
> '''e4f071bc-c4a7-11de-b899-00219bfd1931'',''5fc7684c-750b-11de-835d-001560c9703c''';
> Open;
> i:=RecordCount; // i=0 UNEXPECTED
> finally
> Free;
> end;
>
> end;
>
> what is wrong with the latter code ?
>
> Thank you
>
> Peppe Polpo
>
>
>
>
>
> ------------------------------------
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more ! Yahoo! Groups Links
>
>
>
>


--
John vd Waeter
www.jvdw.nl
www.gps-carpool.net
www.shotinthedark.nl
www.pdaforms.nl
www.dbapocket.nl

john@...