[sqlite] crashed

2014-01-26 Thread d b
Hi all,

crashed at winShmBarrier from sqlite free/sqlite mutex leave/sqlite page
apis.

application using database extensively on windows that time.

any idea?

Thanks,
d b
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Tcl variable substitution issue

2014-01-26 Thread Richard Hipp
On Sun, Jan 26, 2014 at 7:06 PM, Donald Allen wrote:

>  my approach will be to use a language
> better matched to sqlite,
>

You should do what you want, of course.

But this statement is surprising since SQLite is really just a TCL
extension that has "escaped" into the wild.


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


Re: [sqlite] Tcl variable substitution issue

2014-01-26 Thread Donald Allen
Richard Hipp wrote:

This statement sets x to the string value "1", not the numeric value 1.
Try instead:

set x [expr 1]

My response:

In my actual program, not the cut-down example I gave, I set an amount
to be inserted into a numeric field the same way as I did in my
example, with a simple

set amount 12345

An  insert query of the form

insert into  (numeric_field) values (:amount)

Instead of using your solution, my approach will be to use a language
better matched to sqlite, rather than the mess that tcl has become,
where everything is a string, except maybe not quite, such as when you
do some hocus-pocus such as you proposed. It's been awhile since I've
written any tcl and I'd forgotten how bad it is. I tried it again
because I have the need for some scripts that talk to an existing
sqlite database and thought that, given the history of tcl and sqlite,
it would be a good fit. I was wrong.

But thanks for trying to help.

/Don

On Sun, Jan 26, 2014 at 11:33 AM, Donald Allen  wrote:
> There's a several-year-old discussion of this issue here:
>
> http://wiki.tcl.tk/19627
>
> It looks like 'impedance mis-match' is an appropriate term for this
> and that the tcl/sqlite type relationship is problematic, due to the
> typelessness of tcl and the omission in the api of a way to indicate
> the type of the substitution. I'm going to use something other than
> tcl for what I'm doing.
>
> On Sun, Jan 26, 2014 at 10:37 AM, Donald Allen  wrote:
>> This script
>>
>> #!/usr/bin/env tclsh
>>
>> package require sqlite3
>>
>> set x 1
>>
>> sqlite3 db /tmp/foo
>>
>> db eval {select (2 > :x) as foo} {
>> puts "foo was $foo"
>> }
>>
>> run on an up-to-date Arch Linux system produces
>>
>> foo was 0
>>
>> obviously incorrect. There seems to be an issue with variable
>> substitution here. Changing the line in question to
>>
>> db eval {select (2 > 1) as foo} {
>>
>> and re-running produces
>>
>> foo was 1
>>
>> obviously correct.
>>
>> The sqlite documentation on the tcl api says that variable
>> substitution can occur "in any position where it is legal to put a
>> string or number literal". There is no information in the
>> documentation about how to control this, so the api has to be deciding
>> for itself whether a string or numeric literal is appropriate and I
>> think it is getting it wrong here.
>>
>> db eval {select (2 > cast (:x as integer)) as foo} {
>>
>> works correctly.
>>
>> db eval {select (2 > '1') as foo} {
>>
>> produces
>>
>> foo was 0
>>
>> Looks like a bug to me, but perhaps I'm missing something. Comments?
>>
>> /Don Allen
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] pragmas in subselects?

2014-01-26 Thread Simon Slavin

On 26 Jan 2014, at 10:32pm, Petite Abeille  wrote:

> What SQLite would really benefit from is a proper, consistent, queryable data 
> dictionary such as the the standard information schema:
> 
> http://en.wikipedia.org/wiki/Information_schema

I would like that for in SQLite4.  Something close to SQL-92 without messing up 
the tenets of SQLite.  For those interested, it's section 21 page 533 of



but that's a horrible description and very hard to understand.  It if turns out 
to be useful for the SQLite community I can update an simple one with examples 
I've got lying about somewhere.

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


Re: [sqlite] pragmas in subselects?

2014-01-26 Thread Petite Abeille

On Jan 26, 2014, at 11:19 PM, big stone  wrote:

> ==> Is it the reason ?

Well, that pragmas are not directly queryable from SQL just add insult to 
injury. 

What SQLite would really benefit from is a proper, consistent, queryable data 
dictionary such as the the standard information schema:

http://en.wikipedia.org/wiki/Information_schema
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] pragmas in subselects?

2014-01-26 Thread big stone
There is a non-logicality of having "pragma table_info(my_table)" :
- answering like a select,
- but being not usable as a "select", nor queriable by a "select".

Other databases seem more logical on this practical matter.

Multi-motor tools, like dbeaver, have currently much less good support of
"database diagram" when dealing with SQLite.
==> Is it the reason ?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] pragmas in subselects?

2014-01-26 Thread Jay Kreibich

Chapter 10 of Using SQLite covers virtual tables.  One of the examples given 
shows how to wrap a PRAGMA statement, so it can be used as system catalog and 
used in normal SELECT statements.  It would be pretty easy to expand the given 
example to cover almost any SQL statement (including any PRAGMA).

Even if you don't have a copy of the book, you can download the example code 
off the product page:
http://shop.oreilly.com/product/9780596521196.do
The example code download link is on the right side of the page.

Somewhere I've got a virtual table that will wrap any SQL statement, but I'm 
not sure where it is.  Just modify the book's example code to take an SQL 
statement as a table creation parameter and you should be able to create 
something similar.

 -j


On Jan 26, 2014, at 11:01 AM, Petite Abeille  wrote:

> 
> On Jan 26, 2014, at 5:09 PM, Stephan Beal  wrote:
> 
>> Is this possible?
> 
> Sadly, no. Much of a PITA.
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

--  
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it, but showing 
it to the wrong people has the tendency to make them feel uncomfortable." -- 
Angela Johnson




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


Re: [sqlite] pragmas in subselects?

2014-01-26 Thread Luuk

On 26-01-2014 17:09, Stephan Beal wrote:

Hi, all,

is there a syntactical construct which will allow me to use a pragma in a
subselect? e.g. i'm trying to do...

sqlite> pragma table_info(vfile);
cid|name|type|notnull|dflt_value|pk
0|id|INTEGER|0||1
1|vid|INTEGER|0||0
...

sqlite> select name from (pragma table_info(vfile));
Error: near "(": syntax error
sqlite> select name from pragma table_info(vfile);
Error: near "(": syntax error
sqlite> create view v as pragma table_info(vfile);
Error: near "pragma": syntax error
sqlite> create view v as select (pragma table_info(vfile));
Error: near "table_info": syntax error
sqlite> create view v as select pragma table_info(vfile);
Error: near "(": syntax error

Is this possible?




http://stackoverflow.com/questions/685206/sqlite-how-to-get-a-list-of-column-names

answer: not in SQLite
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Tcl variable substitution issue

2014-01-26 Thread Richard Hipp
On Sun, Jan 26, 2014 at 10:37 AM, Donald Allen wrote:

> This script
>
> #!/usr/bin/env tclsh
>
> package require sqlite3
>
> set x 1
>


This statement sets x to the string value "1", not the numeric value 1.
Try instead:

set x [expr 1]



>
> sqlite3 db /tmp/foo
>
> db eval {select (2 > :x) as foo} {
> puts "foo was $foo"
> }
>
> run on an up-to-date Arch Linux system produces
>
> foo was 0
>
> obviously incorrect. There seems to be an issue with variable
> substitution here. Changing the line in question to
>
> db eval {select (2 > 1) as foo} {
>
> and re-running produces
>
> foo was 1
>
> obviously correct.
>
> The sqlite documentation on the tcl api says that variable
> substitution can occur "in any position where it is legal to put a
> string or number literal". There is no information in the
> documentation about how to control this, so the api has to be deciding
> for itself whether a string or numeric literal is appropriate and I
> think it is getting it wrong here.
>
> db eval {select (2 > cast (:x as integer)) as foo} {
>
> works correctly.
>
> db eval {select (2 > '1') as foo} {
>
> produces
>
> foo was 0
>
> Looks like a bug to me, but perhaps I'm missing something. Comments?
>
> /Don Allen
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] pragmas in subselects?

2014-01-26 Thread Petite Abeille

On Jan 26, 2014, at 5:09 PM, Stephan Beal  wrote:

> Is this possible?

Sadly, no. Much of a PITA.

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


Re: [sqlite] Tcl variable substitution issue

2014-01-26 Thread Donald Allen
There's a several-year-old discussion of this issue here:

http://wiki.tcl.tk/19627

It looks like 'impedance mis-match' is an appropriate term for this
and that the tcl/sqlite type relationship is problematic, due to the
typelessness of tcl and the omission in the api of a way to indicate
the type of the substitution. I'm going to use something other than
tcl for what I'm doing.

On Sun, Jan 26, 2014 at 10:37 AM, Donald Allen  wrote:
> This script
>
> #!/usr/bin/env tclsh
>
> package require sqlite3
>
> set x 1
>
> sqlite3 db /tmp/foo
>
> db eval {select (2 > :x) as foo} {
> puts "foo was $foo"
> }
>
> run on an up-to-date Arch Linux system produces
>
> foo was 0
>
> obviously incorrect. There seems to be an issue with variable
> substitution here. Changing the line in question to
>
> db eval {select (2 > 1) as foo} {
>
> and re-running produces
>
> foo was 1
>
> obviously correct.
>
> The sqlite documentation on the tcl api says that variable
> substitution can occur "in any position where it is legal to put a
> string or number literal". There is no information in the
> documentation about how to control this, so the api has to be deciding
> for itself whether a string or numeric literal is appropriate and I
> think it is getting it wrong here.
>
> db eval {select (2 > cast (:x as integer)) as foo} {
>
> works correctly.
>
> db eval {select (2 > '1') as foo} {
>
> produces
>
> foo was 0
>
> Looks like a bug to me, but perhaps I'm missing something. Comments?
>
> /Don Allen
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] pragmas in subselects?

2014-01-26 Thread Stephan Beal
Hi, all,

is there a syntactical construct which will allow me to use a pragma in a
subselect? e.g. i'm trying to do...

sqlite> pragma table_info(vfile);
cid|name|type|notnull|dflt_value|pk
0|id|INTEGER|0||1
1|vid|INTEGER|0||0
...

sqlite> select name from (pragma table_info(vfile));
Error: near "(": syntax error
sqlite> select name from pragma table_info(vfile);
Error: near "(": syntax error
sqlite> create view v as pragma table_info(vfile);
Error: near "pragma": syntax error
sqlite> create view v as select (pragma table_info(vfile));
Error: near "table_info": syntax error
sqlite> create view v as select pragma table_info(vfile);
Error: near "(": syntax error

Is this possible?

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Tcl variable substitution issue

2014-01-26 Thread Donald Allen
This script

#!/usr/bin/env tclsh

package require sqlite3

set x 1

sqlite3 db /tmp/foo

db eval {select (2 > :x) as foo} {
puts "foo was $foo"
}

run on an up-to-date Arch Linux system produces

foo was 0

obviously incorrect. There seems to be an issue with variable
substitution here. Changing the line in question to

db eval {select (2 > 1) as foo} {

and re-running produces

foo was 1

obviously correct.

The sqlite documentation on the tcl api says that variable
substitution can occur "in any position where it is legal to put a
string or number literal". There is no information in the
documentation about how to control this, so the api has to be deciding
for itself whether a string or numeric literal is appropriate and I
think it is getting it wrong here.

db eval {select (2 > cast (:x as integer)) as foo} {

works correctly.

db eval {select (2 > '1') as foo} {

produces

foo was 0

Looks like a bug to me, but perhaps I'm missing something. Comments?

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


Re: [sqlite] Query executes in sqlite manager but not sqlite database in android

2014-01-26 Thread Keith Medcalf

Features are not available before they are introduced.  For example, CTE's will 
not work with 3.6.22.

The "ignore cruft from brain-dead SQL code generators" feature was not added to 
the parser until after 3.6.22.

select * from A JOIN B ON a = b

is mere syntactic sugar for

select * from A,B where a = b

and as such using brackets (in the from list) is useless.  A "feature" was 
added, after 3.6.22,  to ignore the excess cruft generated by many brain-dead 
SQL code generators.

It is and always has been syntactically unacceptable to say:

select * from A, (B, C), D where a.a = b.b AND b.b = b.c and b.c = b.d

Putting brackets around or re-ordering arbitrary clauses in the where clause 
also serves no useful purpose or effect.

The absolute worst and most brain-dead offenders are Microsoft Products (any 
and all of them) and "Microsoft SQL".

The long and the short is that if the brackets do not do anything (ie, are 100% 
syntactic sugar/atmosphere) then get rid of them.  They will only make your 
(and anyone who must look at your SQL) life miserable.

>-Original Message-
>I have used
>#sqlite3 --version
>at command line and got 3.6.22 as the version
>Does that mean the type of query i am trying wont work?




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


Re: [sqlite] Graphic SQLite Client Tool

2014-01-26 Thread big stone
Hi Again,

Is there a longtime user of "http://sqlitestudio.pl; here that could write
about his user experience ?

==> It looks a much simpler tool than dbeaver (no java ! no painfull
installations on 40 old PCs !)
==> I would like to know if it is stable to rely on it for a classroom.

sqlitestudio-2.1.5.exe
md5 : 9d1600399a1d70ff72a4a1b5c9cbfb88
sha1 : f1377993868c9225a1b3c4c447dda84f09a7fc55
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Some intresting from speco_

2014-01-26 Thread Uros Reljic
You got message
From: spe...@hotmail.com
Start

http://moppetadvisor.co.uk/newsletters/opatip.php


End

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


Re: [sqlite] Query executes in sqlite manager but not sqlite database in android

2014-01-26 Thread Kamulegs
Hello

I have used 
#sqlite3 --version
at command line and got 3.6.22 as the version 
Does that mean the type of query i am trying wont work?





On Sunday, January 26, 2014 8:57 AM, big stone [via SQLite] 
 wrote:
 
It seems Android use a pretty outdated SQlite motor : SQlite 3.7.1 = march 
20th, 2012 

http://stackoverflow.com/questions/2421189/version-of-sqlite-used-in-android

SQLite 3.7.11: 

    19-4.4-KitKat 
    18-4.3-Jelly Bean 
    17-4.2-Jelly Bean 
    16-4.1-Jelly Bean 

SQLite 3.7.4: 

    15-4.0.3-Ice Cream Sandwich 
    14-4.0-Ice Cream Sandwich 
    13-3.2-Honeycomb 
    12-3.1-Honeycomb 
    11-3.0-Honeycomb 

SQLite 3.6.22: 

    10-2.3.3-Gingerbread 
    9-2.3.1-Gingerbread 
    8-2.2-Froyo 

SQLite 3.5.9: 

    7-2.1-Eclair 
    4-1.6-Donut 
    3-1.5-Cupcake 
___ 
sqlite-users mailing list 
[hidden email] 
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



 
If you reply to this email, your message will be added to the discussion 
below:http://sqlite.1065341.n5.nabble.com/Query-executes-in-sqlite-manager-but-not-sqlite-database-in-android-tp73466p73477.html
 
To unsubscribe from Query executes in sqlite manager but not sqlite database in 
android, click here.
NAML



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Query-executes-in-sqlite-manager-but-not-sqlite-database-in-android-tp73466p73478.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Graphic SQLite Client Tool

2014-01-26 Thread big stone
Hello sqlite-users,

I'm looking for a Graphic SQLite  Client Tool  to equip a classroom of  old
windows PC.

So far, the best option I found is :
- dbeaver 2.3.6 (multi-motors : SQLite, Mysql, Postgresql)
- with the latest Xerial driver sqlite-jdbc4-3.8.2-SNAPSHOT.jar (with
SQLite3.8.2)


Has anyone knowledge and practice of a better option ?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users