#1 2013-11-14 19:54:15

Roberto Schneiders
Member
From: Santa Catarina, Brazil
Registered: 2012-09-19
Posts: 127
Website

Can I use the IN operator with Fillprepare?

I could not find an example of using the IN operator with FillPrepare (It's a little tricky search for it.)

I tried this way but it does not work:

var
  oMeuProduto: TProduto;
begin
  oMeuProduto := TProduto.Create;
  try
    oMeuProduto.FillPrepare(BaseDeDados, 'estoque IN (?)', [1, 0, 2, 41] );
    while (oMeuProduto.FillOne) do
    begin
      Log(IntToStr(oMeuProduto.ID));
    end;
  finally
    FreeAndNil(oMeuProduto);
  end;
end;

Last edited by Roberto Schneiders (2013-11-14 19:55:41)

Offline

#2 2013-11-14 20:45:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Can I use the IN operator with Fillprepare?

It is not possible, due to SQL itself.

? stands for one parameter, not one array of parameters.

Offline

Board footer

Powered by FluxBB