=C2=A0 =C2= =A0 select * from Town where key in ('Paris', 'London');

and

=C2=A0 =C2=A0 select * from Town where ke= y =3D 'Paris';
=C2=A0 =C2=A0 select * from Town where key= =3D 'London';

..other than round-trip times. =C2=A0Or, I gu= ess, if you're really worried about preparation time, and your lists ar= e limited to some small maximum length X, you could prepare X different que= ries:

=C2=A0 =C2=A0 select * from Town where key in (?);=
=C2=A0 =C2=A0 select * from Town where key in (?, ?);=
=C2=A0 =C2=A0 select * from Town where key in (?, ?, = ?);
=C2=A0 =C2=A0 etc.

and then use the appropriate one each time, but I doubt= that would be a better solution overall.

p
<= div>

On Mon, Apr 30, 2012 at 4:47 PM, Pierre Chalamet wrote= :

I= f I prepare =E2=80=9Cselect * from Town where key in (?)=E2=80=9D=

I will be = able to bind ? to 'Paris' for example [=C3=A8 select * from Town where key in= ('Paris')].

=C2= =A0

If I want to query for 'Paris' and 'London', the= query should be restated to =E2=80=9Cselect * from Town where key in (?, ?= )=E2=80=9D [=C3=A8 select * from Town where key in ('Paris', 'London'= )].

In that ca= se, I must prepare the statement again, losing the benefit of prepare.

=C2= =A0

Maybe there is another way to avoid preparing again ?<= /u>

=C2= =A0

Thanks,

- Pierre

=C2=A0

From: paul cannon [mailto:paul@datastax.com]
Sent: lundi 30 avril 2012 23:36
To: user@cassandra.apache.org
<= b>Subject: Re: execute_prepared_cql_query and variable range filter par= ameter

=C2=A0

Hi Pierre-

<= u>=C2=A0

Yes, each ? can on= ly represent one value at a time (although it can take on a different value= for each actual execution of the prepared query). This is certainly normal= for SQL binding libraries. Not sure why you feel that defeats statement pr= eparation.

=C2=A0

p

=C2=A0

On Mon, Apr 30, 2012 at 3:45= PM, Pierre Chalamet <pierre@chalamet.net> wrote:

Hi all,

=C2=A0

I= s there a support in Cassandra 1.1 for variable range filter parameter (sor= ry I can=E2=80=99t find a right name for that):

se= lect * from TestCF where key in (?)

=C2=A0

using execute_prepared_cql_query ?

=C2=A0

=

In the query above, it seems I = can only bind one value to =E2=80=98?=E2=80=99.

I mean, if several values are requ= ired for =E2=80=98?=E2=80=99 then I have to rewrite the query using several= jokers.

=C2=A0

=

My problem is that this defeats= statement preparation (using prepare_cql_query).

<= p class=3D"MsoNormal"> =C2=A0

= Maybe there is a way to bind an array of values to a s= ingle command joker ?

=C2=A0

Thanks !

- Pie= rre

=C2=A0

=C2=A0

--20cf302d4c36edc67604bef12741--