The question is how does the parameter substitution work. Is it just text
substitution? No, because the queries can be compiled (prepared) on the
server, and the parameters inserted later. So each parameter must replace an
identifier that represents a value. Thus a list probably won't qualify. At
least, thats the conclusion I came to when I tried it a year or so ago.
Unfortunately, that means you'll have to use ORs.
Regards,
Andrew Cooke.
> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, April 21, 1999 9:04 AM
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Query Parameters
>
> Sorry, I may not have explained myself clearly. I'm simply selecting from
> one table (bad choice of names using ID). I'll try again...
>
> SELECT * FROM TABLE
> WHERE SOMEFIELD IN (:SomeValueList)
>
> I realise IN is not the most efficient but it makes constructing the SQL
> at runtime very handy in this case.
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, April 21, 1999 8:45 AM
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Query Parameters
>
>
>
> It's not possible. You will have to use multiple OR's or a join.
> Joins
> are generally quicker than IN anyway.
>
>
>
>
>
>
> Andrew Masters <[EMAIL PROTECTED]> on 20/04/99 18:56:42
>
> Please respond to [EMAIL PROTECTED]
>
> To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
> cc: (bcc: Peter Jones/Logistics&Information
> Technology/Christchurch/Foodstuffs)
> Subject: [DUG]: Query Parameters
>
>
>
>
> Hi All,
>
> I have a query (simplified here) like
>
> SELECT * FROM TABLE
> WHERE ID IN (:IDList)
>
> Under WISQL something like
>
> SELECT * FROM TABLE
> WHERE ID IN (2,3)
>
> works just fine. In my code if I set the param :IDList to say '2,3'
> it does
> not work (returns nothing but no exception either). When set to say
> '2' or
> '3' it works just fine. The IDList parameter is a string type. Is
> there a
> rule of parameter substitution I'm breaking here ?
>
> Thanks
> Andrew Masters
> Clinical Solutions Ltd
> Auckland, NZ
> Ph: +64-9-476-0106
> Fax: +64-9-476-0108
> e: [EMAIL PROTECTED]
>
>
>
> --------------------------------------------------------------------------
> -
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
>
>
>
>
>
>
> --------------------------------------------------------------------------
> -
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz