On Fri, Nov 30, 2018 at 3:15 PM Dominique Devienne
wrote:
> sqlite> .header on
> sqlite> create table t (c, n);
> sqlite> insert into t values (1, 'one'), (2, 'two'), (3, 'three');
> sqlite> select n from t where c in (select value from json_each('[1, 3]'));
> n
> one
> three
Very nice! Now I c
On Fri, 30 Nov 2018 23:25:48 +0900
Simon Walter wrote:
> > SELECT id, data FROM val WHERE id IN ("1, 893, 121212");
...
> I have no idea yet if MySQL and/or PostgreSQL can handle this
> scenario and how they do it.
The important thing to understand about parameterized queries is that
they are n
On Fri, Nov 30, 2018 at 3:26 PM Simon Walter wrote:
> On 11/30/2018 11:20 PM, Dominique Devienne wrote:
> To be honest, I am using apr_dbd as I would like to support more than
> just SQLite. So I will need to play around with MySQL and PostgreSQL at
> least and maybe branch if SQLite is in use. I
On 11/30/2018 11:20 PM, Dominique Devienne wrote:
> On Fri, Nov 30, 2018 at 3:03 PM Dominique Devienne
> wrote:
>
>> On Fri, Nov 30, 2018 at 2:44 PM Richard Hipp wrote:
>>
>>> On 11/30/18, Simon Walter wrote:
Thanks Dominique,
Much appreciated. I can now stop pulling out my hair.
On 2018/11/30 2:52 PM, Simon Walter wrote:
I am trying to make a prepared statement that has a parameter such as
"1, 893, 121212". obviously it is text (a string) but it cannot be
quoted or the result will be:
SELECT id, data FROM val WHERE id IN ("1, 893, 121212");
I understand normally I would
On Fri, Nov 30, 2018 at 3:03 PM Dominique Devienne
wrote:
> On Fri, Nov 30, 2018 at 2:44 PM Richard Hipp wrote:
>
>> On 11/30/18, Simon Walter wrote:
>> > Thanks Dominique,
>> >
>> > Much appreciated. I can now stop pulling out my hair. I will do
>> > something with sprintf.
>>
>> See https://w
On Fri, Nov 30, 2018 at 2:44 PM Richard Hipp wrote:
> On 11/30/18, Simon Walter wrote:
> > Thanks Dominique,
> >
> > Much appreciated. I can now stop pulling out my hair. I will do
> > something with sprintf.
>
> See https://www.sqlite.org/carray.html
Right. Any table-valued function would do
On 11/30/18, Simon Walter wrote:
> Thanks Dominique,
>
> Much appreciated. I can now stop pulling out my hair. I will do
> something with sprintf.
See https://www.sqlite.org/carray.html
Or, failing that, at least use sqlite3_mprintf() rather than
sprintf(). https://www.sqlite.org/printf.html
-
Thanks Dominique,
Much appreciated. I can now stop pulling out my hair. I will do
something with sprintf.
Best regards,
Simon
On 11/30/2018 10:37 PM, Dominique Devienne wrote:
> On Fri, Nov 30, 2018 at 2:10 PM Simon Walter wrote:
>
>> How does one use WHERE x IN (?) with a prepared statement?
On Fri, Nov 30, 2018 at 2:10 PM Simon Walter wrote:
> How does one use WHERE x IN (?) with a prepared statement? What is the
> correct way to do this?
>
You cannot do it. Must use WHERE x IN (?, ?, ?), i.e. an explicit and
known in advance
number of bind placeholders. Or not use binding at all,
I am trying to make a prepared statement that has a parameter such as
"1, 893, 121212". obviously it is text (a string) but it cannot be
quoted or the result will be:
SELECT id, data FROM val WHERE id IN ("1, 893, 121212");
I understand normally I would need the quotes, such as:
SELECT id, name, v
11 matches
Mail list logo