Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread jungle Boogie
On 26 September 2016 at 13:17, R Smith  wrote:
> sqlite3.exe dropped.db "INSERT INTO DropDB_log(date, ip_address, status)
> VALUES (%DATE%, %%A, '%STATUS%');"


YES!

During my lunch break, I don't know why it didn't click to make this a
loop until I got back and saw your helpful reply. :)

IP address needed to be escaped, though:
sqlite3.exe dropped.db "INSERT INTO DropDB_log(date, ip_address,
status) VALUES (%DATE%, '%%A', '%STATUS%');"



-- 
---
inum: 883510009027723
sip: jungleboo...@sip2sip.info
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Simon Slavin

On 26 Sep 2016, at 10:14pm, Richard Hipp  wrote:

> The first test failure cause the process to exit with a non-zero return code.

Good.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Richard Hipp
On 9/26/16, Simon Slavin  wrote:
>
> On 26 Sep 2016, at 9:42pm, Richard Hipp  wrote:
>
>> Generates output: "testcase-100 ok".  Or, it generates an error
>> message if the expected result does not appear.
>
> Does it also change the exit code of the application ?  If it does then you
> can test the output in shell scripts and more easily use the CLI as part of
> a test suite.

The first test failure cause the process to exit with a non-zero return code.

>
> Or maybe it would be better to implement another dot command which
> immediately quit the CLI and returned a code indicating whether the previous
> output matched a GLOB value.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Simon Slavin

On 26 Sep 2016, at 9:42pm, Richard Hipp  wrote:

> Generates output: "testcase-100 ok".  Or, it generates an error
> message if the expected result does not appear.

Does it also change the exit code of the application ?  If it does then you can 
test the output in shell scripts and more easily use the CLI as part of a test 
suite.

Or maybe it would be better to implement another dot command which immediately 
quit the CLI and returned a code indicating whether the previous output matched 
a GLOB value.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite3 database slowdown at 1GB

2016-09-26 Thread Domingo Alvarez Duarte

Hello Richard !

I'm trying to create a sqlite3 database with some pubic data (the 
sqlite3 dump gziped is 9184MB) that took a very long time to build (2 
days tested on linux and os x). I was trying to vacuum it to see if I 
could get better performance but it take too long so I did a ".dump" (2 
hours) and now I'm trying to restore but when it reaches around 1GB it 
slowdown a lot (only grow 1MB every minute).


See attached schema. It doesn't use foreign keys or heavy constraints.

So after several tests I could isolate a test case (see attached, the 
sample data is at 
https://www.endad.eu/tst-sqlite3/favorecidos-nis.txt.xz 41MB 25M lines, 
it also show stats of work done) it seems that the distribution of some 
fields cause a lot of btree partitions.


On this test case the data was get from the mentioned database, it's an 
int64 field used to unique identify individuals, there is 25M and 
sqlite3 can insert 80% of then in 15% of the total time and then take 
75% of the time to insert 20% of the final data.


I usually test it on a linux and os x and it behaves the same on both, 
the io activity is insane in the last 20% of the data.
The full database is not usable (35GB) most operations take too long 
(minutes and hours).


After several tests to try overcome this problem, I've tried to prefill 
the problematic table with data known beforehand and update it later 
instead of insert, thinking this would move away the btree balancing 
slowdown on insertion but for my surprise the slowdown remain there it 
seems that sqlite first delete then reinsert the whole record (because I 
can not explain it other way, I even filled all fields with excess data 
so the update would have plenty of space to do it's job).



I understand that you are busy but I think that this can be another good 
test to check performance bottleneck, as I mentioned the data is public 
so I can provide it or you can grab yourself.


Sample data like:

20902122112
15032539272
12282967455
16129244577
20730772521
10262168283
13789627770
17021574841
16405626831
17044198056

Thank you so much for your attention and great work !

sql schema
==
create table if not exists processed(
id integer primary key,
count integer
);

create table if not exists municipios(
id integer primary key,
uf varchar collate nocase_slna,
nome varchar collate nocase_slna
);

create table if not exists programas(
id integer primary key,
codigo_funcao integer not null,
codigo_subfuncao integer not null,
codigo_programa integer not null,
codigo_acao integer not null
);
create unique index if not exists programas_all_idx on programas(
codigo_funcao, codigo_subfuncao, codigo_programa, codigo_acao);

create table if not exists fontes_finalidade(
id integer primary key,
nome varchar collate nocase_slna unique
);

create table if not exists favorecidos(
id integer primary key,
nome varchar collate nocase_slna,
municipio_id integer,
programa_id integer not null,
fonte_finalidade_id integer not null
);

create table if not exists bolsas_familia(
id integer primary key,
favorecido_id integer not null,
valor_parcela numeric,
mes_competencia integer
);
--create index if not exists bolsas_familia_favorecidos_idx on 
bolsas_familia(favorecido_id);


--insert or ignore into favorecidos(id, 
nome,programa_id,fonte_finalidade_id) select nis, nome,1,1 from 
adb.favorecidos order by nis;


==

main.cpp


#include 
#include 
#include 

#include "sqlite3.h"

using namespace std;

namespace os {

int getmillicount()
{
  // Something like GetTickCount but portable
  // It rolls over every ~ 12.1 days (0x10/24/60/60)
  // Use GetMilliSpan to correct for rollover
  timeb tb;
  ftime(  );
  int nCount = tb.millitm + (tb.time & 0xf) * 1000;
  return nCount;
}
};

struct SQLite3Statement
{
sqlite3_stmt *stmt;
SQLite3Statement(){stmt=NULL;}
~SQLite3Statement()
{
if(stmt) sqlite3_finalize(stmt);
}
int bind_exec(std::string , sqlite3_int64 p2)
{
if(stmt)
{
sqlite3_bind_text(stmt, 1, p1.c_str(), p1.size(), NULL);
sqlite3_bind_int64(stmt, 2, p2);
int rc = sqlite3_step(stmt);
sqlite3_reset(stmt);
return rc;
}
return -1;
}
};

struct SQLite3
{
sqlite3 *db;
SQLite3(const char *dbname)
{
db = NULL;
sqlite3_open_v2(dbname, , SQLITE_OPEN_CREATE | 
SQLITE_OPEN_READWRITE, NULL);
}
~SQLite3()
{
sqlite3_close(db);
}

int exec_dml(const char *szSql)
{
return sqlite3_exec(db, szSql, NULL, NULL, NULL);
}

int prepare(SQLite3Statement , const char *szSql)
{
return sqlite3_prepare_v2(db, szSql, -1, , NULL);
}
};

struct file
{
FILE *fp;
file(const char *fname, const char *mode)
{
fp = fopen(fname, mode);
}
int tell()
{
return ftell(fp);

Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Richard Hipp
On 9/26/16, David Raymond  wrote:
> So the .help on .testcase says:
> .testcase NAME Begin redirecting output to 'testcase-out.txt'
>
> And .check says:
> .check GLOBFail if output since .testcase does not match

These dot-commands help in writing scripts that test various SQL
language features in SQLite.

For example, I could test various row-value comparisons using a script
like this:

.testcase 100
SELECT (1,2,3)<(1,2,4), (1,2,3)<(1,NULL,4), (1,2,3)<(2,NULL,1);
.check 1||1


Running that script using:

 ./sqlite3 http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread R Smith

Correction:

FOR /F "tokens=1" %%A IN (machinelist.txt) DO (
  sqlite3.exe dropped.db "INSERT INTO DropDB_log(date, ip_address, 
status) VALUES (%DATE%, %%A, '%STATUS%');"

)

The file SET must be in parentheses.


On 2016/09/26 10:09 PM, R Smith wrote:
I can't test this since I don't have your file or DB, but it should 
put you on the right track. This example assumes only 1 IP address on 
each line and will ignore any other tokens.


FOR /F "tokens=1" %%A IN "machinelist.txt" DO (
  sqlite3.exe dropped.db "INSERT INTO DropDB_log(date, ip_address, 
status) VALUES (%DATE%, %%A, '%STATUS%');"

)

(Notice all the unnecessary DB quotes and backticks removed - those 
are only needed when the string doesn't make sense in machine terms, 
and these all are o.k.)


HTH,
Ryan


On 2016/09/26 9:34 PM, jungle Boogie wrote:

Hi All,


I'm attempting to make a windows batch file that reads a text file and
inserts a new record for each entry:

sqlite3.exe dropped.db  "INSERT INTO
`DropDB_log`(`date`,`ip_address`,`status`) VALUES
(%DATE%,readfile('machinelist.txt'),'%STATUS%');"

Right now, it does this:
date,ip_address,status20160926,128.10.10.1
128.10.10.3
128.10.10.4
128.10.10.5,up


I'd like this:
20160926,128.10.10.1,up
20160926,128.10.10.3,up
20160926,128.10.10.4,down
20160926,128.10.10.5,up

Will the readfile + the separator command allow this kind of hackery
in windows batch files?

Thanks!




___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread David Raymond
So the .help on .testcase says:
.testcase NAME Begin redirecting output to 'testcase-out.txt'

And .check says:
.check GLOBFail if output since .testcase does not match

So it's a way to check actual TEXT output vs expected TEXT output, right? Since 
I'm not sure of the normal reason for this I just played around with it real 
quick. Here're some tests where I don't know if it's working as intended or 
not. (For below copy/pastes headers default on) 


Windows 7 command prompt

sqlite_source_id()
2016-09-26 12:38:22 fe89225eab777c2c9cb1cbc31092b9e39f516842

--
.check on its own kills the session and quits back to the command prompt



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> .check
Usage: .check GLOB-PATTERN

D:\Temp>


--
Also kills the session if it fails the test.



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> create table tbl (a int, b text, c real);

sqlite> insert into tbl values (1, 'one', 1.0), (2, 'two', 2.0), (3, 'three', 
3.0);

sqlite> .testcase a

sqlite> select * from tbl where a = 1;

sqlite> .check 1|one|1.0
testcase-a FAILED
 Expected: [1|one|1.0]
  Got: [a|b|c
1|one|1.0
]

D:\Temp>


--
If testcase-out.txt exists from a previous session then .check looks at it even 
if you didn't do a .testcase on that session:



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> create table tbl (a int, b text, c real);

sqlite> insert into tbl values (1, 'one', 1.0), (2, 'two', 2.0), (3, 'three', 
3.0);

sqlite> .check a|b|c*
testcase- ok

sqlite>


--
Doing a .testcase immediately followed by a .check gives an error and quits to 
command prompt.



sqlite> .testcase b

sqlite> .check *
Error: cannot read 'testcase-out.txt'

D:\Temp>



--
Same thing happens if you do run queries but don't have any returned rows



D:\Temp>sqlite3
SQLite version 3.15.0 2016-09-26 12:38:22
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> create table tbl (a int, b text, c real);

sqlite> insert into tbl values (1, 'one', 1.0), (2, 'two', 2.0), (3, 'three', 
3.0);

sqlite> .testcase a

sqlite> select * from tbl where a = 4;

sqlite> .check *
Error: cannot read 'testcase-out.txt'

D:\Temp>



-Original Message-
From: David Raymond 
Sent: Friday, September 23, 2016 12:57 PM
To: 'SQLite mailing list'
Subject: RE: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

-Add the ".testcase" and ".check" dot-commands.

Is there documention on what these are? I don't see anything on them in the 
linked CLI page draft.
https://www.sqlite.org/draft/cli.html

-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Richard Hipp
Sent: Thursday, September 22, 2016 3:04 PM
To: General Discussion of SQLite Database
Subject: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

Our current schedule for the next SQLite release (3.15.0) is for 2016-10-14.

Your beta-tests are appreciated.  You can get a pre-release snapshot
from the download page (https://www.sqlite.org/download.html) and you
can review the change log
(https://www.sqlite.org/draft/releaselog/3_15_0.html).

The trunk (https://www.sqlite.org/src/timeline?r=trunk) is stable and
is being used by the SQLite developers for mission-critical processes.

Thank you for your attention.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread R Smith

I can't test this since I don't have your file or DB, but it should put you on 
the right track. This example assumes only 1 IP address on each line and will 
ignore any other tokens.

FOR /F "tokens=1" %%A IN "machinelist.txt" DO (
  sqlite3.exe dropped.db "INSERT INTO DropDB_log(date, ip_address, status) VALUES 
(%DATE%, %%A, '%STATUS%');"
)

(Notice all the unnecessary DB quotes and backticks removed - those are 
only needed when the string doesn't make sense in machine terms, and 
these all are o.k.)


HTH,
Ryan


On 2016/09/26 9:34 PM, jungle Boogie wrote:

Hi All,


I'm attempting to make a windows batch file that reads a text file and
inserts a new record for each entry:

sqlite3.exe dropped.db  "INSERT INTO
`DropDB_log`(`date`,`ip_address`,`status`) VALUES
(%DATE%,readfile('machinelist.txt'),'%STATUS%');"

Right now, it does this:
date,ip_address,status20160926,128.10.10.1
128.10.10.3
128.10.10.4
128.10.10.5,up


I'd like this:
20160926,128.10.10.1,up
20160926,128.10.10.3,up
20160926,128.10.10.4,down
20160926,128.10.10.5,up

Will the readfile + the separator command allow this kind of hackery
in windows batch files?

Thanks!




___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite separator command on one insert column

2016-09-26 Thread Simon Slavin

On 26 Sep 2016, at 8:34pm, jungle Boogie  wrote:

> I'm attempting to make a windows batch file that reads a text file and
> inserts a new record for each entry:

Why not replace the INSERT command with a '.import' command to import data from 
a CSV (or some other separator) file ?

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite separator command on one insert column

2016-09-26 Thread jungle Boogie
Hi All,


I'm attempting to make a windows batch file that reads a text file and
inserts a new record for each entry:

sqlite3.exe dropped.db  "INSERT INTO
`DropDB_log`(`date`,`ip_address`,`status`) VALUES
(%DATE%,readfile('machinelist.txt'),'%STATUS%');"

Right now, it does this:
date,ip_address,status20160926,128.10.10.1
128.10.10.3
128.10.10.4
128.10.10.5,up


I'd like this:
20160926,128.10.10.1,up
20160926,128.10.10.3,up
20160926,128.10.10.4,down
20160926,128.10.10.5,up

Will the readfile + the separator command allow this kind of hackery
in windows batch files?

Thanks!


-- 
---
inum: 883510009027723
sip: jungleboo...@sip2sip.info
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Simon Slavin

> On 26 Sep 2016, at 7:48pm, Warren Young  wrote:
> 
>> ​What can I do to beta test?

The other part of the question is "How do I download the beta-test version in 
order to beta-test it ?".

For technical reasons, the download page in the /draft/ version of the web site 
doesn't actually include download links.  The pre-release version can be found 
in the yellow portion at the top of this page:



While I'm here, I note that



does not include documentation for the two newly-introduced dot commands.  I 
think someone else noted this too but I can't find the post at the moment.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3.15.0 scheduled for 2016-10-14

2016-09-26 Thread Warren Young
On Sep 25, 2016, at 4:50 AM, Cecil Westerhof  wrote:
> 
> 2016-09-22 21:04 GMT+02:00 Richard Hipp :
> 
>> Our current schedule for the next SQLite release (3.15.0) is for
>> 2016-10-14.
>> 
>> Your beta-tests are appreciated.
> 
> ​What can I do to beta test?

First, just try it against your existing application, to see if there are any 
regressions.

Second, go through the changelog and see if there are any new features or fixes 
that interest you:

  https://www.sqlite.org/draft/releaselog/current.html
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread Eric Grange
Nice solution and works like a charm, thanks Clemens!

On Mon, Sep 26, 2016 at 4:22 PM, Clemens Ladisch  wrote:

> Eric Grange wrote:
> > I am generating a json with json_object() function, and I would like to
> > omit the null or default fields from the output json
>
> SELECT (SELECT json_group_object(key, value)
> FROM json_each(json_object('field1', field1, 'field2', field2))
> WHERE value IS NOT NULL)
> FROM MyTable;
>
>
> Regards,
> Clemens
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread Clemens Ladisch
Eric Grange wrote:
> I am generating a json with json_object() function, and I would like to
> omit the null or default fields from the output json

SELECT (SELECT json_group_object(key, value)
FROM json_each(json_object('field1', field1, 'field2', field2))
WHERE value IS NOT NULL)
FROM MyTable;


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread Eric Grange
Using coalesce on the value produces the field with the JSON, with an empty
string (or whatever it was coalesced again).

What I really would like to get is {"field1":"value"} rather than
{"field1":"value","field2":null} or {"field1":"value","field2":""}

I also tried setting the field name to null, but that triggers an error
"json_object() labels must be TEXT"

On Mon, Sep 26, 2016 at 2:28 PM, R Smith  wrote:

>
> On 2016/09/26 11:15 AM, Eric Grange wrote:
>
>> Hi,
>>
>> I am generating a json with json_object() function, and I would like to
>> omit the null or default fields from the output json (for compacity
>> reasons)
>>
>> When there is only one such field, I have used a "case when" like in
>>
>>
>> select
>> case when field2 is null then
>>json_object('field1', field1)
>> else
>>json_object('field1', field1, 'field2', field2)
>> end
>> ...
>>
>>
>> but when there are multiple such optional fields, this approach becomes
>> unwieldy.
>>
>
> I'm not experienced playing with the JSON extension much, but the solution
> that feels correct to me would be:
>
> select json_object('field1', COALESCE(field1,'""'), 'field2',
> COALESCE(field2,'""'))
>
> or some such variant that produces the correct output...
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Ideas for optional json fields?

2016-09-26 Thread R Smith


On 2016/09/26 11:15 AM, Eric Grange wrote:

Hi,

I am generating a json with json_object() function, and I would like to
omit the null or default fields from the output json (for compacity reasons)

When there is only one such field, I have used a "case when" like in


select
case when field2 is null then
   json_object('field1', field1)
else
   json_object('field1', field1, 'field2', field2)
end
...


but when there are multiple such optional fields, this approach becomes
unwieldy.


I'm not experienced playing with the JSON extension much, but the 
solution that feels correct to me would be:


select json_object('field1', COALESCE(field1,'""'), 'field2', 
COALESCE(field2,'""'))
 


or some such variant that produces the correct output...
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Ideas for optional json fields?

2016-09-26 Thread Eric Grange
Hi,

I am generating a json with json_object() function, and I would like to
omit the null or default fields from the output json (for compacity reasons)

When there is only one such field, I have used a "case when" like in


select
   case when field2 is null then
  json_object('field1', field1)
   else
  json_object('field1', field1, 'field2', field2)
   end
...


but when there are multiple such optional fields, this approach becomes
unwieldy.

Anyone has a better idea?

Eric
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite IN operator on a Tcl list

2016-09-26 Thread Dominique Devienne
On Sun, Sep 25, 2016 at 8:54 PM, Gerry Snyder 
wrote:

> [...] the compiled statement has to know how many values are being looked
> at by IN.
>
> At least up til now. Perhaps having row values will change this. We
> should know soon.


Only if you can bind them :)

And the SQLite-TCL could also use the carray extension,
but that would be a security hole I suppose. (unless the TCL runtime can
lookup
the list variable's name dynamically, in which case it wouldn't be the list
address
but a "safe surrogate" in that case. That would probably work. Probably no
one
thought of doing that yet, since eponymous vtables are relatively new)

Or [db eval  ...] recognizes it's used with a variable in a position that
needs
to be runtime-expanded textually, and thus cannot be prepared+bind, but
that would require knowing the context of bind placeholders, which is not
part
of the SQLite API, since there's no parse AST per-se for statements, part of
the public API. Also on my wish list that clashes with the "lite" part. --DD
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users