Parameter in TADOQuery sometimes failes



I have a TADOQuery which fails when using a parameter. If I open the
following SQL in a TADOQuery:
SELECT * FROM MyTable WHERE id IN ("ab","ba","ca")
I received 3 records.

But if I introduce a parameter:
SELECT * FROM MyTable WHERE id IN (:IDS)
and pass the string as following:
queryStoringen.Parameters.ParamValues['IDS'] := '"ab","ba","ca"';
queryStoringen.open;
Then I receive no records where I expect the 3 records.

When I execute the following:
queryStoringen.Parameters.ParamValues['IDS'] := 'ab';
queryStoringen.open;
Then I receive one record.

Has anybody a clue why is a list of strings is failing?

Thanks in advance, Frank v/d Schoot

.



Relevant Pages

  • TAdoQuery sql question
    ... Is it possible to access/change the SQL that is used to update a TAdoQuery? ... That fails because it's trying to update the 'junk' field. ...
    (borland.public.delphi.database.ado)
  • Re: TADOQuery exception
    ... Alan wrote: ... It raised exception when I assign a string to the text property of the ... TADOQuery. ...
    (borland.public.delphi.database.ado)
  • Re: TADOQuery exception
    ... It raised exception when I assign a string to the text property of the ... I checked that both TADOConnection and TADOQuery components have no ... Contribute to the Indy Docs project: http://docs.indyproject.org ...
    (borland.public.delphi.database.ado)
  • Re: Truncated Blob Field in TADOQuery
    ... I used a TADOStoredProc instead and the problem went away. ... suspect that ti has to do with the manner in which TADOQuery handles ... and pumping it down into a MS SQL db locally. ... > of the parameter in the TADOQuery component before calling the ExecSQL ...
    (borland.public.delphi.database.ado)
  • Re: MSAccess and ADO
    ... database I use TADOQuery and SQL ... Stanko. ...
    (borland.public.delphi.database.ado)