Subject | Re: [IBO] what's wrong with this syntax ? |
---|---|
Author | Hans |
Post date | 2010-01-07T22:45:58Z |
I believe the keys in the brackets
must be single quoted, not double.
must be single quoted, not double.
----- Original Message -----
From: "peppepolpo" <peppepolpo@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, January 07, 2010 2:32 PM
Subject: [IBO] what's wrong with this syntax ?
>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
>
>
>