[sqlite] Sqlite subqueries

2015-02-24 Thread Paul Sanderson
Search the mail list for "Column name as a variable" for a similar discussion
Paul
www.sandersonforensics.com
skype: r3scue193
twitter: @sandersonforens
Tel +44 (0)1326 572786
http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit
-Forensic Toolkit for SQLite
email from a work address for a fully functional demo licence


On 24 February 2015 at 21:58, Igor Tandetnik  wrote:
> On 2/24/2015 4:37 PM, russ lyttle wrote:
>>
>> I'm trying to create a field in a table to hold the name of a second
>> table, then retrieve that name for use.
>
>
> You can't. SQL doesn't work this way. Reconsider your design.
> --
> Igor Tandetnik
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Appropriate Uses For SQLite

2015-02-24 Thread James K. Lowden
On Thu, 19 Feb 2015 07:21:17 -0800
Roger Binns  wrote:

> There is a lot that would have to be done with it:
> 
> - - make the IR stable across releases
> - - add more general instructions beyond only what is needed for SQL
> - - expose an API that takes the IR
> - - possibly redesign it to make static verification possible, like
> Java bytecode did.  

As it happens, I'm working on a project exactly like that, and can
attest that it's plenty of work!  

You might be tempted to think -- I was -- that it would be nice to have
a C library of relational algebra operators on a transactional store.
No SQL, just C functions like ra_project, ra_select, and ra_join.  What
could be nicer than, 

t3 = ra_join(db, t1, t2)

?   Well, there's the little matter of "join on what?", so you get 

t3 = ra_join(db, t1, t2, how)

and then there's the question of "what goes in 'how'?".  IOW, how to
specify the join criteria without syntax, using only data?  In fact,
consider a simpler problem, 

t2 = ra_select(db, t1, "where id > 2")

and suddenly you're back in Parserville whether you wanted to be or
not.  You're inventing a language, a very limited, incomplete version
of SQL.  Limited, that is, until you want to say something like "where
exists (select 1 from t5 where t1.id < t5.id)".  Before you know it,
you've reinvented more than half of SQL, except that the ratio of SQL
speakers to your-language speakers approaches infinity.  

Now, you could avoid adding complexity to your language by moving more
of the relational algebra stuff out of it, 

t3 = ra_semijoin( db, t1, 
ra_join(db, t1, t2, ra_natural) )

or something like that.  To Richard's point, the more you do that, the
*less* there is for the optimizer to do, and the more the application
comes to control (for good and ill) the order of operation.  It's very
difficult to maintain the relational abstraction *and* be efficient,
because the C language defines an order of operation, specifically
"greedy evaluation".  That means inner functions are evaluated before
outer ones, inviting production of temporaries that a query optimizer
would just laugh at.  

None of this is news.  Query optimizers have (for decades) been
"lowering the filter" to minimize the processed data.  DBMSs and vector
languages (R, but also APL, NumPy, Matlab, inter alia) are *languages*
precisely so that they can *effect* high-level instructions without
interpreting them literally.  That's not an option in C.  (It's also
what makes things like BLAS such a bear to write *and* use.)  

I'm happy to discuss this off-list in more detail with anyone
interested.  Bringing it back to the topic, I would only say, "be
careful what you wish for".  You want SQL, or something very like it,
to provide abtraction and execution efficiency, because C can't
do that kind of interpretation.  

--jkl


[sqlite] Sqlite subqueries

2015-02-24 Thread Igor Tandetnik
On 2/24/2015 8:42 PM, russ lyttle wrote:
> The 'a' table defines spaces to be controlled, the 'b' tables the
> control schedules and parameters.
> It would not be unreasonable to assume the 'a' table has >100 rows.
> Each row in the 'a' table is associated with 3 'b' tables, all the names
> known in advance and created off line at the same time as the row in the
> 'a' table.
> Each 'b' table has up to 1,440 rows.

Replace these three tables with a single table, holding three times as 
many rows. It would have an extra column holding the "original source" 
indicator - a value that indicates which of the three tables this row 
originated from. Now, in table "a" store this indicator where you 
planned to store the table name.
-- 
Igor Tandetnik



[sqlite] Complex insert query to normalised database

2015-02-24 Thread James K. Lowden
On Wed, 18 Feb 2015 14:16:32 +0100
Staffan Tylen  wrote:

> I suspect that this is wrong as nobody has suggested it but isn't
> this what triggers are meant to solve?

Triggers were invented before SQL defined what we now call Declarative
Referential Integrity (DRI).  It is (I'm going to say) always
preferable to declare your integrity constraints rather than
programming them imperatively.  

If you find yourself in a situation in which DRI is insufficient,
it's a good idea to look for a normalization problem or consider if the
trigger is being "abused", i.e., being used for something other than
referential integrity enforcement.  There are exceptions, but not
many.  

--jkl


[sqlite] Sqlite subqueries

2015-02-24 Thread russ lyttle

Thanks. The application is for an energy conservation application.

The 'a' table defines spaces to be controlled, the 'b' tables the
control schedules and parameters.
It would not be unreasonable to assume the 'a' table has >100 rows.
Each row in the 'a' table is associated with 3 'b' tables, all the names
known in advance and created off line at the same time as the row in the
'a' table.
Each 'b' table has up to 1,440 rows.

The application will loop through the 'a' table, recover a row from the
target 'b' table and execute it on the space described in the 'a' table.
Users can edit (add or delete rows) in the 'b' tables, but nothing else.

There are also 'c' and 'd' tables.
I could do this by composing queries outside sqlite. But that doesn't
seem very elegant and more error prone.

Because the 'a' table looks a lot like the sqlite_master table, I
thought there might be a way do do it all in an sql script.


On 02/24/2015 06:12 PM, R.Smith wrote:
> There's been many discussions on this topic, you can search for it, but
> I will try to recap in short:
> 
> SQL does not work like this, not in SQLite or any other SQL engine may
> an entity construct be referenced by an uncontrolled data value. Of
> course it is easy to get around this in code whereby you can read a
> table name from one DB and use it in an SQL statement for any DB, but
> the onus here is on the maker of such software to implement whatever
> safety checks are needed to prevent corruption or indeed SQL injections
> and other mischief made possible by vulnerabilities exposed in this way.
> 
> What you are trying here is not possible in pure SQL by design.
> 
> There may however be other ways of achieving your goals, maybe
> explaining to us what you would like to do in a system/setup like this
> will help - surely someone here have done some similar thing before and
> they are always glad to assist.
> 
> 
> On 2015-02-24 11:37 PM, russ lyttle wrote:
>> I got the "Using SQLite" book and didn't find the answer there, or in a
>> Google, DuckDuckGo, or Gigiblast search.
>> I'm trying to create a field in a table to hold the name of a second
>> table, then retrieve that name for use.
>> The code below is the simplest of all the things I've tried. Can anyone
>> say what should be done so (10.) returns the same as (8.)?
>> Thanks
>>
>> 1.sqlite> CREATE TABLE a (id INTEGER PRIMARY KEY, name VARCHAR(16),
>> anotherTable TEXT);
>> 2.sqlite> SELECT * FROM sqlite_master;
>>  table|a|a|2|CREATE TABLE a (id INTEGER PRIMARY KEY, name
>> VARCHAR(16), anotherTable TEXT)
>> 3.sqlite> INSERT INTO a (name, anotherTable) VALUES ('table1', 'b');
>> 4.sqlite> SELECT * FROM a;
>>  1|table1|b
>> 5.sqlite> CREATE TABLE b (id INTEGER PRIMARY KEY, name VARCHAR(16),
>> data FLOAT);
>> 6.sqlite> INSERT INTO b (name, data) VALUES ('B1', 35.0);
>> 7.sqlite> INSERT INTO b (name, data) VALUES ('B2', 40.0);
>> 8.sqlite> SELECT * FROM b;
>>  1|B1|35.0
>>  2|B2|40.0
>> 9.sqlite> SELECT anotherTable FROM a WHERE name='table1';
>>  b
>> 10.sqlite> SELECT * FROM (SELECT anotherTable FROM a Where
>> name='table1');
>>  b
>>  sqlite>
>>
>>
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users at mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> 
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: 
<http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/attachments/20150224/c2381c45/attachment.pgp>


[sqlite] Behaviour when subquery behind comparison operator in where-clause returns empty result

2015-02-24 Thread James K. Lowden
On Wed, 18 Feb 2015 08:55:37 +0100
gunnar  wrote:

instead of 

> SELECT *
> FROM ordercallback
> WHERE account=@ACCOUNT
>AND cb_seq_num>(
>  SELECT cb_seq_num
>  FROM ordercallback
>  WHERE cb_uuid=@CBUUID);

SELECT *
FROM ordercallback ocb
WHERE account=@ACCOUNT
   AND exists (
 SELECT 1 
 FROM ordercallback
 WHERE cb_uuid=@CBUUID
and ocb.cb_seq_num > cb_seq_num );

No union, no limit, no order.  Just existential quantification.  :-)

--jkl


[sqlite] Database connection from within Visual Studio

2015-02-24 Thread Erik Ejlskov Jensen




Maybe a smaller number of downloads and a more readable download page would 
improve the user experience here.
Mvh / Regards


Erik Ejlskov Jensen
http://twitter.com/erikej 



[sqlite] Err

2015-02-24 Thread Jonathan Camilleri
Unusual output when trying a SQL Select statement from the command line

SQLite version 3.8.8.2 2015-01-30 14:30:45
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open taxi-invoicing-db
sqlite> .stats on
sqlite> .tables
Address  Invoice  VERSION_CONTROL
Customer InvoiceLine
sqlite> select * from version_control;
Memory Used: 80840 (max 86816) bytes
Number of Outstanding Allocations:   182 (max 193)
Number of Pcache Overflow Bytes: 6904 (max 6904) bytes
Number of Scratch Overflow Bytes:0 (max 0) bytes
Largest Allocation:  64000 bytes
Largest Pcache Allocation:   1176 bytes
Largest Scratch Allocation:  0 bytes
Lookaside Slots Used:10 (max 54)
Successful lookaside attempts:   173
Lookaside failures due to size:  41
Lookaside failures due to OOM:   0
Pager Heap Usage:7508 bytes
Page cache hits: 7
Page cache misses:   6
Page cache writes:   0
Schema Heap Usage:   4032 bytes
Statement Heap/Lookaside Usage:  2368 bytes
Fullscan Steps:  0
Sort Operations: 0
Autoindex Inserts:   0
Virtual Machine Steps:   8
sqlite> select count(1) from version_control;
0
Memory Used: 81824 (max 86816) bytes
Number of Outstanding Allocations:   184 (max 193)
Number of Pcache Overflow Bytes: 8080 (max 8080) bytes
Number of Scratch Overflow Bytes:0 (max 0) bytes
Largest Allocation:  64000 bytes
Largest Pcache Allocation:   1176 bytes
Largest Scratch Allocation:  0 bytes
Lookaside Slots Used:6 (max 54)
Successful lookaside attempts:   193
Lookaside failures due to size:  46
Lookaside failures due to OOM:   0
Pager Heap Usage:8672 bytes
Page cache hits: 1
Page cache misses:   1
Page cache writes:   0
Schema Heap Usage:   4040 bytes
Statement Heap/Lookaside Usage:  1616 bytes
Fullscan Steps:  0
Sort Operations: 0
Autoindex Inserts:   0
Virtual Machine Steps:   12
sqlite> .tabls
Error: unknown command or invalid arguments:  "tabls". Enter ".help" for
help
sqlite> .tables
Address  Invoice  VERSION_CONTROL
Customer InvoiceLine
sqlite> .vfsname ?AUX?
sqlite>
sqlite> .TABLES
Error: unknown command or invalid arguments:  "TABLES". Enter ".help" for
help
sqlite> .tables
Address  Invoice  VERSION_CONTROL
Customer InvoiceLine
sqlite> select * from VERSION_CONTROL;
Memory Used: 82024 (max 86816) bytes
Number of Outstanding Allocations:   184 (max 196)
Number of Pcache Overflow Bytes: 8080 (max 8080) bytes
Number of Scratch Overflow Bytes:0 (max 0) bytes
Largest Allocation:  64000 bytes
Largest Pcache Allocation:   1176 bytes
Largest Scratch Allocation:  0 bytes
Lookaside Slots Used:10 (max 54)
Successful lookaside attempts:   448
Lookaside failures due to size:  86
Lookaside failures due to OOM:   0
Pager Heap Usage:8672 bytes
Page cache hits: 12
Page cache misses:   0
Page cache writes:   0
Schema Heap Usage:   4040 bytes
Statement Heap/Lookaside Usage:  2368 bytes
Fullscan Steps:  0
Sort Operations: 0
Autoindex Inserts:   0
Virtual Machine Steps:   8
sqlite>

See online doc at http://www.sqlite.org/cli.html

-- 
Jonathan Camilleri

Mobile (MT): ++356 7982 7113
E-mail: camilleri.jon at gmail.com
Please consider your environmental responsibility before printing this
e-mail.

I usually reply to e-mails within 2 business days.  If it's urgent, give me
a call.


[sqlite] Sqlite subqueries

2015-02-24 Thread Igor Tandetnik
On 2/24/2015 4:37 PM, russ lyttle wrote:
> I'm trying to create a field in a table to hold the name of a second
> table, then retrieve that name for use.

You can't. SQL doesn't work this way. Reconsider your design.
-- 
Igor Tandetnik



[sqlite] Sqlite subqueries

2015-02-24 Thread russ lyttle
I got the "Using SQLite" book and didn't find the answer there, or in a
Google, DuckDuckGo, or Gigiblast search.
I'm trying to create a field in a table to hold the name of a second
table, then retrieve that name for use.
The code below is the simplest of all the things I've tried. Can anyone
say what should be done so (10.) returns the same as (8.)?
Thanks

1.sqlite> CREATE TABLE a (id INTEGER PRIMARY KEY, name VARCHAR(16),
anotherTable TEXT);
2.sqlite> SELECT * FROM sqlite_master;
table|a|a|2|CREATE TABLE a (id INTEGER PRIMARY KEY, name
VARCHAR(16), anotherTable TEXT)
3.sqlite> INSERT INTO a (name, anotherTable) VALUES ('table1', 'b');
4.sqlite> SELECT * FROM a;
1|table1|b
5.sqlite> CREATE TABLE b (id INTEGER PRIMARY KEY, name VARCHAR(16),
data FLOAT);
6.sqlite> INSERT INTO b (name, data) VALUES ('B1', 35.0);
7.sqlite> INSERT INTO b (name, data) VALUES ('B2', 40.0);
8.sqlite> SELECT * FROM b;
1|B1|35.0
2|B2|40.0
9.sqlite> SELECT anotherTable FROM a WHERE name='table1';
b
10.sqlite> SELECT * FROM (SELECT anotherTable FROM a Where
name='table1');
b
sqlite>


-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: 
<http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/attachments/20150224/3389318b/attachment.pgp>


[sqlite] outer join/order by bug?

2015-02-24 Thread Simon Davies
On 24 February 2015 at 15:20, Simon Davies  
wrote:
> On 24 February 2015 at 15:02, Grisha Vinevich  wrote:
>> There seems to be some problem with left outer join in Windows version of 
>> sqlite3.
>> I try to use the following (simplified) schema:
>>

. 
. 
. 
>> When I run this on SQLFiddle, It 
>> returns (correctly) 2 records.
>> But when I run this on Windows (using sqlite3.exe command-line utility, for 
>> example), no records are returned. Note that if I remove "order by" clause 
>> or one of the joins or even dummy condition inside the first join, the query 
>> works OK.
>> The same happens on Windows Phone using sqlite.net.
>> Any suggestions would be appreciated...
>> Thanks in advance,
>> Grisha.
>
> Perhaps you could advise what version you are using.
>
> When I try:
>
> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>
> C:\>sqlite3
> SQLite version 3.7.15.1 2012-12-19 20:39:10
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite>
> sqlite> CREATE TABLE "A" ( "Name" text);
> sqlite> CREATE TABLE "Items" ( "ItemName" text , "Name" text );
> sqlite> INSERT INTO "Items" VALUES('Item1','Parent');
> sqlite> INSERT INTO "Items" VALUES('Item2','Parent');
> sqlite> CREATE TABLE "B" ( "Name" text );
> sqlite>
> sqlite> select Items.ItemName
>...> from Items
>...> left outer join A on (A.Name =
> Items.ItemName and Items.ItemName = 'dummy')
>...> left outer join B on (B.Name = Items.ItemName)
>...> where Items.Name = 'Parent';
> Item1
> Item2
> sqlite>
>
> I get the same result with v 3.8.8.2 from the download page
>
> Regards,
> Simon

Sorry - missed the order by clause.

Confirm your observation using 3.8.8.2, but get your expected result
using 3.7.15.1

Regards,
Simon


[sqlite] outer join/order by bug?

2015-02-24 Thread Simon Davies
On 24 February 2015 at 15:02, Grisha Vinevich  wrote:
> There seems to be some problem with left outer join in Windows version of 
> sqlite3.
> I try to use the following (simplified) schema:
>
> CREATE TABLE "A" ( "Name" text);
> CREATE TABLE "Items" ( "ItemName" text , "Name" text );
> INSERT INTO "Items" VALUES('Item1','Parent');
> INSERT INTO "Items" VALUES('Item2','Parent');
> CREATE TABLE "B" ( "Name" text );
>
> Now I try to run the following query (again, simplified version of my real 
> query):
>
> select Items.ItemName
> from Items
> left outer join A on (A.Name = Items.ItemName and 
> Items.ItemName = 'dummy')
> left outer join B on (B.Name = Items.ItemName)
> where Items.Name = 'Parent'
> order by Items.ItemName;
> When I run this on SQLFiddle, It 
> returns (correctly) 2 records.
> But when I run this on Windows (using sqlite3.exe command-line utility, for 
> example), no records are returned. Note that if I remove "order by" clause or 
> one of the joins or even dummy condition inside the first join, the query 
> works OK.
> The same happens on Windows Phone using sqlite.net.
> Any suggestions would be appreciated...
> Thanks in advance,
> Grisha.

Perhaps you could advise what version you are using.

When I try:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\>sqlite3
SQLite version 3.7.15.1 2012-12-19 20:39:10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
sqlite> CREATE TABLE "A" ( "Name" text);
sqlite> CREATE TABLE "Items" ( "ItemName" text , "Name" text );
sqlite> INSERT INTO "Items" VALUES('Item1','Parent');
sqlite> INSERT INTO "Items" VALUES('Item2','Parent');
sqlite> CREATE TABLE "B" ( "Name" text );
sqlite>
sqlite> select Items.ItemName
   ...> from Items
   ...> left outer join A on (A.Name =
Items.ItemName and Items.ItemName = 'dummy')
   ...> left outer join B on (B.Name = Items.ItemName)
   ...> where Items.Name = 'Parent';
Item1
Item2
sqlite>

I get the same result with v 3.8.8.2 from the download page

Regards,
Simon


[sqlite] outer join/order by bug?

2015-02-24 Thread Grisha Vinevich
There seems to be some problem with left outer join in Windows version of 
sqlite3.
I try to use the following (simplified) schema:

CREATE TABLE "A" ( "Name" text);
CREATE TABLE "Items" ( "ItemName" text , "Name" text );
INSERT INTO "Items" VALUES('Item1','Parent');
INSERT INTO "Items" VALUES('Item2','Parent');
CREATE TABLE "B" ( "Name" text );

Now I try to run the following query (again, simplified version of my real 
query):

select Items.ItemName
from Items
left outer join A on (A.Name = Items.ItemName and 
Items.ItemName = 'dummy')
left outer join B on (B.Name = Items.ItemName)
where Items.Name = 'Parent'
order by Items.ItemName;
When I run this on SQLFiddle, It returns 
(correctly) 2 records.
But when I run this on Windows (using sqlite3.exe command-line utility, for 
example), no records are returned. Note that if I remove "order by" clause or 
one of the joins or even dummy condition inside the first join, the query works 
OK.
The same happens on Windows Phone using sqlite.net.
Any suggestions would be appreciated...
Thanks in advance,
Grisha.



[sqlite] Using incremental BLOB functions against a BLOB column in a virtual table

2015-02-24 Thread Evans, Randall
Thanks to Richard Hipp and Hick Gunter for their replies on this topic.

Given that support for support for BLOBs in virtual tables differs from that 
for BLOBs in physical tables, is there any method or function available to the 
sqlite3_x() caller that can be used to distinguish tables defined as 
virtual tables vs. physical tables?

Thanks in advance for any assistance provided.

Randy Evans

> 
> From: Richard Hipp 
> 
> On 2/23/15, Evans, Randall  wrote:
> > Can the incremental BLOB functions (sqlite_blob_open(),
> > sqlite_blob_read(),
> > etc) access BLOB column data defined in a SQLite virtual table? If it
> > matters, I am only interested in read-only access at this time.
> 
> no.
> 
> >
> > If the answer is yes, is there any facility in virtual table support
> > for xColumn or any other method that will expose to the virtual table
> > module the positioning/length values supplied as the 3rd and 4th
> > arguments of the
> > sqlite_blob_read() function (N bytes and offset values)?
> 
> There would have to be, in order for incremental blob I/O to be supported
> on virtual tables.  The absence of such a method is one reason why the
> answer above is "no".
> 
> >
> >
> > Randy Evans


[sqlite] Err

2015-02-24 Thread Igor Tandetnik
On 2/24/2015 12:42 PM, Jonathan Camilleri wrote:
> Unusual output when trying a SQL Select statement from the command line

So what's unusual about it? What specifically seems to be the problem?
-- 
Igor Tandetnik



[sqlite] sqlite doesn't log reason for failing to open WAL file

2015-02-24 Thread Török Edwin
Hi,

When SQLite fails to create a file it tries reopening readonly and only if that 
fails too it logs the error.
However by that time the original error (for file creation) is lost.

Testcase:

$ cat >testcase.sh 

[sqlite] Database connection from within Visual Studio

2015-02-24 Thread Joe Mistachkin

Erik Ejlskov Jensen wrote:
>
> Maybe a smaller number of downloads and a more readable download page
> would improve the user experience here.
>

Various parties have, at one time or another, requested each and every one
of the release package "variations" listed on the download page.

Do you have any other specific suggestions on how to improve the usability
and/or readability of the download page?

--
Joe Mistachkin



[sqlite] outer join/order by bug?

2015-02-24 Thread Richard Hipp
On 2/24/15, Grisha Vinevich  wrote:
> There seems to be some problem with left outer join in Windows version of
> sqlite3.

Thanks for the report.  This appears to be a query planner bug
introduced for SQLite version 3.8.8 by the check-in at
https://www.sqlite.org/src/timeline?c=d95d03

We'll probably have a fix out soon.

> I try to use the following (simplified) schema:
>
> CREATE TABLE "A" ( "Name" text);
> CREATE TABLE "Items" ( "ItemName" text , "Name" text );
> INSERT INTO "Items" VALUES('Item1','Parent');
> INSERT INTO "Items" VALUES('Item2','Parent');
> CREATE TABLE "B" ( "Name" text );
>
> Now I try to run the following query (again, simplified version of my real
> query):
>
> select Items.ItemName
> from Items
> left outer join A on (A.Name = Items.ItemName and
> Items.ItemName = 'dummy')
> left outer join B on (B.Name = Items.ItemName)
> where Items.Name = 'Parent'
> order by Items.ItemName;
> When I run this on SQLFiddle, It
> returns (correctly) 2 records.
> But when I run this on Windows (using sqlite3.exe command-line utility, for
> example), no records are returned. Note that if I remove "order by" clause
> or one of the joins or even dummy condition inside the first join, the query
> works OK.
> The same happens on Windows Phone using sqlite.net.
> Any suggestions would be appreciated...
> Thanks in advance,
> Grisha.
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
drh at sqlite.org


[sqlite] Is readline ubiquitous on 32-bit x86 Linux?

2015-02-24 Thread Andreas Kupries
A possible (and small alternative) to readline would be Antirez "linenoise".
Steve Bennet's fork adds windows portability and some other things.

https://github.com/antirez/linenoise
https://github.com/msteveb/linenoise

That is small enough to be directly built as part of the shell, I believe.



On Tue, Feb 24, 2015 at 10:01 AM, Dan Kennedy  wrote:
>
>
> The pre-built sqlite3 shell tool for x86 Linux available for download here:
>
>   http://www.sqlite.org/download.html
>
> does not include readline support. Which makes it painful to use.
>
> Does anyone think that many systems would be affected if it dynamically
> linked against the system readline? This means that the binary would not
> work on systems without libreadline.so installed. Or is readline considered
> ubiquitous by now?
>
> Dan.
>
>
> ___
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



-- 
Andreas Kupries
Senior Tcl Developer
Code to Cloud: Smarter, Safer, Faster?
F: 778.786.1133
andreask at activestate.com, http://www.activestate.com
Learn about Stackato for Private PaaS: http://www.activestate.com/stackato


[sqlite] Using incremental BLOB functions against a BLOB column in a virtual table

2015-02-24 Thread Hick Gunter
Incremental BLOB I/O makes certain assertions that cannot be guaranteed (much 
less verified at runtime) for virtual tables (e.g. 1: unique rowids that 2: can 
be used for access) and needs to know how to read/write them (which is under 
the control of the virtual table author).

-Urspr?ngliche Nachricht-
Von: Evans, Randall [mailto:REvans at seasoft.com]
Gesendet: Dienstag, 24. Februar 2015 01:47
An: sqlite-users at mailinglists.sqlite.org
Betreff: [sqlite] Using incremental BLOB functions against a BLOB column in a 
virtual table

Can the incremental BLOB functions (sqlite_blob_open(), sqlite_blob_read(), 
etc) access BLOB column data defined in a SQLite virtual table? If it matters, 
I am only interested in read-only access at this time.

If the answer is yes, is there any facility in virtual table support for 
xColumn or any other method that will expose to the virtual table module the 
positioning/length values supplied as the 3rd and 4th arguments of the 
sqlite_blob_read() function (N bytes and offset values)?


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


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.