Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread IN Clause with parameter
Sun, Feb 22 2015 6:12 AMPermanent Link

Petter Topp

Is it possible to use parameters with IN operator?

I would like to produce a list of noncontiguous records based on an Column of Integer type.

"Where IN (:Values)"

Will this work?
And how do I assign the parameters using ParamByName in code?
Sun, Feb 22 2015 8:28 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Petter

>Is it possible to use parameters with IN operator?

No, neither DBISAM nor ElevateDB allows this Frown

>I would like to produce a list of noncontiguous records based on an Column of Integer type.
>
>"Where IN (:Values)"
>
>Will this work?
>And how do I assign the parameters using ParamByName in code?

You have to build the SQL in code. You can sort of do it by putting the sql into the query then doing something like

query.sql.text := StringReplace(query.sql.text,':Values','my comma separated in string',[rfIgnoreCase,rfReplaceAll]);

Roy Lambert

Sun, Feb 22 2015 3:06 PMPermanent Link

Petter Topp

Roy,

To bad - it would have been convenient in this case - it's a quite extensive script for generating a report...

I guess that I will have to do this like You suggest.

Thanks
Petter



Roy Lambert wrote:

Petter

>Is it possible to use parameters with IN operator?

No, neither DBISAM nor ElevateDB allows this Frown

>I would like to produce a list of noncontiguous records based on an Column of Integer type.
>
>"Where IN (:Values)"
>
>Will this work?
>And how do I assign the parameters using ParamByName in code?

You have to build the SQL in code. You can sort of do it by putting the sql into the query then doing something like

query.sql.text := StringReplace(query.sql.text,':Values','my comma separated in string',[rfIgnoreCase,rfReplaceAll]);

Roy Lambert
Image