Re: [sqlite] Statement is not executing

2011-07-05 Thread Cecil Westerhof
In case people are wondering. :-D 2011/7/3 Cecil Westerhof cldwester...@gmail.com I am not sure if it is a SQLite problem, or a Java problem. While filling a table I get an error Statement is not executing. It happens in the following code: System.out.printf(%d, %s, %s\n

Re: [sqlite] Statement is not executing

2011-07-03 Thread Cecil Westerhof
2011/7/3 Simon Slavin slav...@bigfraud.org On 3 Jul 2011, at 12:19am, Cecil Westerhof wrote: I am not sure if it is a SQLite problem, or a Java problem. While filling a table I get an error Statement is not executing. It happens in the following code: System.out.printf

[sqlite] Statement is not executing

2011-07-02 Thread Cecil Westerhof
); System.out.print(After citation\n); I see the first output, but not the second. After this there is a -journal file. What could be happening here? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin

Re: [sqlite] Continuous exclusive lock

2011-07-01 Thread Cecil Westerhof
with a message that the database is locked. When I make sure I do a COMMIT after a change and immediately a BEGIN EXCLUSIVE, I do not have to worry about anything. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi

Re: [sqlite] Continuous exclusive lock

2011-07-01 Thread Cecil Westerhof
the program stops with the message that the table is locked and he can continue where he left of. ;-} -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
I am writing a desktop application in which I want to have exclusive rights. In this way I do not need to check if the data has changed when the user of my program wants to change records. Is this possible? -- Cecil Westerhof ___ sqlite-users mailing

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
for when I want really exclusive access. Thanks. I am going to try it. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
for me, but I understood it should not be possible. I just tried it with BEGIN IMMEDIATE. Gives exactly the same results. So properly I should stick to the BEGIN IMMEDIATE? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
application I would not do this, and check that the data has not changed before doing an update. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
2011/6/30 Simon Slavin slav...@bigfraud.org On 30 Jun 2011, at 6:34pm, Cecil Westerhof wrote: It is a single user application and database. Sorry about that, Cecil. I was remembering some of the bonehead manoeuvres some of my former clients have pulled, then complained about

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
, it is to late. (When it is raining, you can not repair your roof. When it is not raining, it is not necessary.) -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Compute percentage?

2011-06-29 Thread Cecil Westerhof
, but in the general case it could. Or maybe even better instead of doing * 100 in the first select, do * .01 in the second. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Meaning of values in sqlite_stat1

2011-06-27 Thread Cecil Westerhof
. The first value seems the number of records (but could also be the last distributed key), the last could be the lowest key in the table. Is this correct? But when there are three values –weights–, what is the meaning of the middle value? -- Cecil Westerhof

Re: [sqlite] The last records of a query

2011-06-26 Thread Cecil Westerhof
BY weights.measureDate DESC LIMIT${SHOW_NUMBER} ) ORDER BY weights.measureDate ; Is a lot neater and also a little more efficient. Thanks again. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080

Re: [sqlite] The last records of a query

2011-06-26 Thread Cecil Westerhof
FLOAT, UNIQUE ( categoryID, measureDate ) ); The select is on the categoryID and measureDate. The UNIQUE constraint is good enough, or is there needed more? -- Cecil Westerhof ___ sqlite-users mailing list

[sqlite] Again bug in .indices

2011-06-26 Thread Cecil Westerhof
: sqlite_autoindex_weights_1 Should it not be shown in the first instance also? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] How to check foreign keys

2011-06-26 Thread Cecil Westerhof
Because SQLite is not a server, it is possible that someone removes a record that should not be removed because of a foreign key constraint. How to check if a database is still correct? There is no check after: PRAGMA FOREIGN_KEYS = ON; I checked. -- Cecil Westerhof

Re: [sqlite] Again bug in .indices

2011-06-26 Thread Cecil Westerhof
. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] How to check foreign keys

2011-06-26 Thread Cecil Westerhof
) ON UPDATE CASCADE ON DELETE CASCADE ); Then one could detect missing keys in T1 with: SELECT DISTINCT T2.id1 FROM T2 LEFT OUTER JOIN T1 ON T2.id1 == T1.id1 WHERE T1.id1 IS NULL ORDER BY T2.id1 ); Okay, so it can only be done manually? -- Cecil

Re: [sqlite] How to check foreign keys

2011-06-26 Thread Cecil Westerhof
foreign_keys on should set a bit in the database so it will no longer work with foreign_keys off. That would be an improvement. Of-course, it should then also not work with a SQLite version who does not set this bit. Otherwise you keep having this problem. -- Cecil Westerhof

[sqlite] The last records of a query

2011-06-25 Thread Cecil Westerhof
With LIMIT you can get the first N records of a SELECT. Is it also possible to get the last N records? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] The last records of a query

2011-06-25 Thread Cecil Westerhof
2011/6/25 Cecil Westerhof cldwester...@gmail.com With LIMIT you can get the first N records of a SELECT. Is it also possible to get the last N records? Thanks for the answers. I had thought about both options, but was wondering if I had missed something better. I original opted for the LIMIT

[sqlite] How to register on the wiki

2011-06-10 Thread Cecil Westerhof
I like to make speed comparisons for sqlite. Asking on the list for the used code did not give a result, so I like to try it on the wiki. But you have to login and I do not see a way to register. -- Cecil Westerhof ___ sqlite-users mailing list sqlite

Re: [sqlite] How to register on the wiki

2011-06-10 Thread Cecil Westerhof
to speed.html. The condensed code shown there should be somewhere uncondensed (I hope). Then I could use this as a starting point. Still it would not be wrong to register on the wiki I think. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Speed comparison

2011-06-08 Thread Cecil Westerhof
There is no need for new speed comparisons? 2011/6/6 Cecil Westerhof cldwester...@gmail.com: I saw that there is the need for a speed comparison. I have MySQL (5.1.53) installed (and when necessary I could install PostgreSQL). Would it be interesting if I made those tests? If yes, what

[sqlite] Problem with create table and strftime

2011-06-06 Thread Cecil Westerhof
am using SQLite version 3.7.5. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Bug in .indices

2011-06-06 Thread Cecil Westerhof
The help says that .indices shows all indices. But it shows at least not the PRIMARY KEY indices. When using: .indices I get nothing. When using: -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi

[sqlite] Bug in .indices

2011-06-06 Thread Cecil Westerhof
Something went wrong, so again. The help says that .indices shows all indices. But it shows at least not the PRIMARY KEY indices. When using: .indices I get nothing. When using: .indices weights I get: sqlite_autoindex_weights_1 -- Cecil Westerhof

Re: [sqlite] Problem with create table and strftime

2011-06-06 Thread Cecil Westerhof
constraint is disappeared and the DEFAULT is changed. This sounds extremely unlikely. If I had to guess, I'd suspect you already have the table in the database, with the old schema, and the new CREATE TABLE statement fails. You are right. I made a mistake. My excuses for the noise. -- Cecil

Re: [sqlite] Bug in .indices

2011-06-06 Thread Cecil Westerhof
2011/6/6 Igor Tandetnik itandet...@mvps.org: Cecil Westerhof cldwester...@gmail.com wrote: The help says that .indices shows all indices. But it shows at least not the PRIMARY KEY indices. When using:    .indices I get nothing. Works for me: sqlite create table t(x text primary key

Re: [sqlite] Bug in .indices

2011-06-06 Thread Cecil Westerhof
sqlite_autoindex_weights_1 -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Speed comparison

2011-06-06 Thread Cecil Westerhof
that this would not be a big problem. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users