[sqlite] Use journal after program crashed

2016-05-24 Thread Cecil Westerhof
Until now I did not need it, but better inform before I do. ;-) When a program crashes it is possible that you have a journal file with things that are not committed. Is there a way to find out what those are? (And selectively commit?) -- Cecil Westerhof

Re: [sqlite] Use journal after program crashed

2016-05-24 Thread Cecil Westerhof
2016-05-25 3:49 GMT+02:00 Richard Hipp <d...@sqlite.org>: > On 5/24/16, Cecil Westerhof <cldwester...@gmail.com> wrote: > > Until now I did not need it, but better inform before I do. ;-) > > > > When a program crashes it is possible that you ha

[sqlite] Setting locale for ORDER BY

2015-12-09 Thread Cecil Westerhof
oes change the ordering of ORDER BY (? comes after z). What is the correct way to get the same result in Java? -- Cecil Westerhof

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Cecil Westerhof
it can be done?? -- Cecil Westerhof

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Cecil Westerhof
2015-12-12 15:24 GMT+01:00 R Smith : > > > On 2015/12/12 4:18 PM, Cecil Westerhof wrote: > >> ?I have the following query: >> SELECT >> (SELECT COUNT(*) FROM proverbs)AS Total >> , (SELECT COUNT(*) FROM prov

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Cecil Westerhof
2015-12-12 16:06 GMT+01:00 Luuk : > On 12-12-15 15:18, Cecil Westerhof wrote: > >> ?I have the following query: >>> SELECT >>> (SELECT COUNT(*) FROM proverbs) AS Total >>> , (SELECT COUNT(*) FROM proverbs WHERE NOT used IS NULL) AS

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Cecil Westerhof
2015-12-12 16:23 GMT+01:00 Igor Tandetnik : > On 12/12/2015 9:18 AM, Cecil Westerhof wrote: > >> But I want something like: >> ?SELECT >> (SELECT COUNT(*) FROM proverbs)AS Total >> , (SELECT COUNT(*) FROM proverbs W

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Cecil Westerhof
2015-12-12 19:00 GMT+01:00 Simon Slavin : > > On 12 Dec 2015, at 2:42pm, Cecil Westerhof wrote: > > >> SELECT > >>(SELECT COUNT(*) FROM proverbs) AS Total > >>, (SELECT COUNT(*) FROM proverbs WHERE used IS NOT NULL) AS Used > >>

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Cecil Westerhof
2015-12-12 19:17 GMT+01:00 Simon Slavin : > > On 12 Dec 2015, at 6:14pm, Cecil Westerhof wrote: > > > ?Not at the moment. But maybe that is a good idea.? > > With clauses like > > >>> WHERE used IS NOT NULL) AS Used > > >>> WHERE used IS NULL &

[sqlite] Selecting total and not used in one query

2015-12-12 Thread Cecil Westerhof
2015-12-12 21:10 GMT+01:00 Simon Slavin : > > On 12 Dec 2015, at 7:52pm, Cecil Westerhof wrote: > > > ?Here http://www.tutorialspoint.com/sqlite/sqlite_indexes.htm it is said > > that you should not use an index on columns that use a high number of > NULL > > valu

[sqlite] Putting an index on a boolean

2015-12-12 Thread Cecil Westerhof
? By the way: I am thinking about using UUID for projectID and groupID, but I heard somewhere that it was a bad idea to use UUID for an indexed field. Is this true?? -- Cecil Westerhof

[sqlite] Putting an index on a boolean

2015-12-12 Thread Cecil Westerhof
2015-12-12 21:45 GMT+01:00 Richard Hipp : > On 12/12/15, Cecil Westerhof wrote: > > I am playing with SQLite. I am thinking about writing an application for > > projects. At the moment I have the following: > > > > CREATE TABLE `projects` ( > > `p

[sqlite] Integrity check with a SQL command

2015-12-12 Thread Cecil Westerhof
s. Is there a way to use a SQL statement to verify that the data is not corrupt? (Everything should be a tree.) Also is there a SQL command to verify the debt is not more as for example five?? -- Cecil Westerhof

[sqlite] Putting an index on a boolean

2015-12-12 Thread Cecil Westerhof
2015-12-12 22:07 GMT+01:00 Darren Duncan : > On 2015-12-12 12:56 PM, Cecil Westerhof wrote: > >> By the way: I am thinking about using UUID for projectID and groupID, >>>> >>> but I >>> >>>> heard somewhere that it was a bad idea to use UUI

[sqlite] Putting an index on a boolean

2015-12-12 Thread Cecil Westerhof
2015-12-12 22:12 GMT+01:00 Mark Hamburg : > Though to the extent that speed is proportional to data size, it would be > good to use something other than hexadecimal to store UUIDs. Binary blobs > would be the most compact, but ASCII85 encoding would work well if you need > strings. > > Also, if

[sqlite] Integrity check with a SQL command

2015-12-12 Thread Cecil Westerhof
2015-12-12 22:13 GMT+01:00 Richard Hipp : > On 12/12/15, Cecil Westerhof wrote: > > I have the following tables: > > CREATE TABLE "projects" ( > > "projectID" TEXT PRIMARY KEY, > > ); > ?? > > CREATE INDEX subprojects_projectID_

[sqlite] Putting an index on a boolean

2015-12-12 Thread Cecil Westerhof
because I did not think it important. It is: CREATE TABLE "groups" ( "groupID" TEXT PRIMARY KEY, "name"TEXT ); And probably I should make name unique.? -- Cecil Westerhof

[sqlite] Putting an index on a boolean

2015-12-12 Thread Cecil Westerhof
rs" in filenames, you only need to use quotes identifying > field names if you are making the atrocious error of using restricted > symbols or words as column names. If you do not do that, then you do not > need them. > ?I can go back to not using them. :-D -- Cecil Westerhof

[sqlite] Set update time, but not always

2015-12-13 Thread Cecil Westerhof
I have a table where I would most of the time update a field lastChecked to current_date when I update the record. But it is possible that I sometimes want to update a record without updating lastChecked. Is this possible, or should I update it (almost) always manually? -- Cecil Westerhof

[sqlite] Checking Foreign Keys

2015-12-13 Thread Cecil Westerhof
not enabled I did the first INSERT from: https://www.sqlite.org/foreignkeys.html When opening the database in a session with Foreign Keys enabled, is there a method to find this record that breaks the rules? -- Cecil Westerhof

[sqlite] Set update time, but not always

2015-12-13 Thread Cecil Westerhof
2015-12-13 13:18 GMT+01:00 R Smith : > > On 2015/12/13 1:31 PM, Cecil Westerhof wrote: > >> I have a table where I would most of the time update a field lastChecked >> to >> current_date when I update the record. But it is possible that I sometimes >> want to

[sqlite] Checking Foreign Keys

2015-12-13 Thread Cecil Westerhof
2015-12-13 13:52 GMT+01:00 R Smith : > > > On 2015/12/13 2:17 PM, Cecil Westerhof wrote: > >> I am continuing with my exploration of SQLite. :-) >> >> At the moment I am working with Foreign Keys. They need to be enabled. >> When >> you do not do this

[sqlite] Checking Foreign Keys

2015-12-13 Thread Cecil Westerhof
2015-12-13 13:53 GMT+01:00 Dominique Devienne : > On Sun, Dec 13, 2015 at 1:17 PM, Cecil Westerhof > wrote: > > > At the moment I am working with Foreign Keys. They need to be enabled. > When > > you do not do this it is possible to enter records that break t

[sqlite] Locked database

2015-12-14 Thread Cecil Westerhof
could write a script to warn me about the lock. -- Cecil Westerhof

[sqlite] Locked database

2015-12-14 Thread Cecil Westerhof
2015-12-14 12:40 GMT+01:00 Clemens Ladisch : > Cecil Westerhof wrote: > > I have a crontab job which uses a SQLite database. Sometimes this > database > > is locked because I used SQLite DB Browser, but did not Write or Revert > > Changes. It looks like that w

[sqlite] Geting the errorcode in Java

2015-12-14 Thread Cecil Westerhof
0 database is locked null ?I would expect the first one to be 5?. What am I doing wrong? -- Cecil Westerhof

[sqlite] Locked database

2015-12-15 Thread Cecil Westerhof
2015-12-14 15:14 GMT+01:00 Clemens Ladisch : > Cecil Westerhof wrote: > > sqlite3 "${DATABASE}" "begin immediate" 2>/dev/null > > errorCode="${?}" > > if [[ "${errorCode}" -eq 5 ]] ; then > > printf "${DATABASE} is lo

[sqlite] Geting the errorcode in Java

2015-12-15 Thread Cecil Westerhof
2015-12-15 18:51 GMT+01:00 gwenn : > Your code looks good to me. > You should report an issue here: https://github.com/xerial/sqlite-jdbc > ?Done.? -- Cecil Westerhof

[sqlite] Locked database

2015-12-27 Thread Cecil Westerhof
2015-12-27 18:11 GMT+01:00 Yuriy M. Kaminskiy : > (I know, I'm a bit late for discussion, but...) > > Cecil Westerhof > writes: > > > 2015-12-14 12:40 GMT+01:00 Clemens Ladisch : > > > >> Cecil Westerhof wrote: > >> > I have a crontab job which u

[sqlite] Locked database

2015-12-28 Thread Cecil Westerhof
2015-12-27 21:51 GMT+01:00 Cecil Westerhof : > invocation), you should use SQLite binding to some real program language > >> (perl, tcl, python,...) instead of sh and sqlite3. > > > ?Well, for just checking if a database is locked I think it is good > enough. But I a

[sqlite] Using colation in Java

2015-12-29 Thread Cecil Westerhof
When working in Python I can use: con.create_collation("mycollation", collate) To change the sort order. How should I do this in Java? -- Cecil Westerhof

[sqlite] Using colation in Java

2015-12-29 Thread Cecil Westerhof
2015-12-29 1:35 GMT+01:00 Rowan Worth : > On 29 December 2015 at 08:23, Cecil Westerhof > wrote: > > > When working in Python I can use: > > con.create_collation("mycollation", collate) > > > > To change the sort order. How should I do this in

[sqlite] Date as integer

2015-12-30 Thread Cecil Westerhof
', datetime, 'unixepoch', 'localtime') as datetime ,description FROM simpleLog ORDER BY datetime DESC Is this a good way to go, or is there a better way? -- Cecil Westerhof

[sqlite] Date as integer

2015-12-30 Thread Cecil Westerhof
?? 2015-12-30 2:56 GMT+01:00 Richard Hipp : > On 12/29/15, Cecil Westerhof wrote: > > I first had the following table: > > CREATE TABLE simpleLog ( > >datetimeTEXT NOT NULL PRIMARY KEY DEFAULT CURRENT_TIMESTAMP, > >description TEXT NOT NULL > > ) &g

[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
. You are right. I made a mistake. My excuses for the noise. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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. &

Re: [sqlite] Bug in .indices

2011-06-06 Thread Cecil Westerhof
FLOAT, muscle FLOAT, UNIQUE ( categoryID, measureDate ) ); sqlite> .indices sqlite> .indices weights 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

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 test

[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
ng? How does another > DBMS do this? I was referring 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] 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

Re: [sqlite] The last records of a query

2011-06-26 Thread Cecil Westerhof
weights.fat >,weights.water >,weights.muscle >FROM weights >,categories >WHEREcategories.desc = 'Cecil' > AND weights.categoryID = categories.id >ORDER BY weights.measureDate DESC >LIMIT${SHOW_NUMBER} >

Re: [sqlite] The last records of a query

2011-06-26 Thread Cecil Westerhof
T, muscle 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 ___ sqlit

[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
ture and a documentation bug ;) > Well I think it should at least be documented. I caught me by surprise. -- 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
WHERE T1.id1 IS NULL > ORDER BY T2.id1 > ); > Okay, so it can only be done manually? -- 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
problem. There's an argument that > switching 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 ha

[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] Compute percentage?

2011-06-29 Thread Cecil Westerhof
e it does not matter much, 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] 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
exclusive writer, but other processes can continue to read. To get > exclusive access in WAL mode, use PRAGMA locking_mode=EXCLUSIVE. > Is good enough for me. My only problem is that between reading the data and writing the changes, I want to be sure that no one has changed the data. For me t

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
");" + "COMMIT;"); The COMMIT is to be sure that this will not unlock the database. It does not. But I can read the database. Not a problem for me, but I understood it should not be possible. I just tried it with "BEGIN IMMEDIATE". Gives exa

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
not think it is a problem. With a multi-user 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

Re: [sqlite] Continuous exclusive lock

2011-06-30 Thread Cecil Westerhof
often things are not important, but when they become, 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

Re: [sqlite] Continuous exclusive lock

2011-07-01 Thread Cecil Westerhof
am for a second time (because you forgot it was already open), the second one is terminated 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 _

Re: [sqlite] Continuous exclusive lock

2011-07-01 Thread Cecil Westerhof
something. Is interrupted. Forgot that he was working on it and starts the program again. In this case the program stops with the message that the table is locked and he can continue where he left of. ;-} -- Cecil Westerhof ___ sqlite-users mailing

[sqlite] Statement is not executing

2011-07-02 Thread Cecil Westerhof
etString(1, citation); 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

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&

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: >

[sqlite] Order with another sequence

2015-10-09 Thread Cecil Westerhof
When I use ORDER BY an ? comes after a z. Is it possible to make an ? come after a z? If it is important I am using SQLite 3.8.6 and Python 3.4.1. -- Cecil Westerhof

[sqlite] Using SQLite for storing photo's

2016-04-14 Thread Cecil Westerhof
probably better to store the pictures them-self in one file pro picture and only store the (meta-)data in SQL. What would be a good way? -- Cecil Westerhof

[sqlite] Working with booleans

2016-04-14 Thread Cecil Westerhof
When working with booleans at the moment I use: isActive INTEGER NOT NULL CHECK(isActive in (0, 1)) Is this a good way, or would be using a CHAR with a check op 'T', or 'F' be better? -- Cecil Westerhof

[sqlite] Journal 4.6 KB, after commit database 6 or 7 KB bigger

2016-04-14 Thread Cecil Westerhof
I have seen several times that the journal was 4.6 KB, but that fter committing the database had grown with 6 or 7 KB. No big problem, but I find it strange. What could be happening here? I would expect it not togrow more as 5 KB. -- Cecil Westerhof

[sqlite] Exclude NULL from index

2016-04-14 Thread Cecil Westerhof
If I would have a table where a lot of values are NULL. Would it be possible to exclude those records from the index? I would only search for a certain value not for NULL. Or is it the default that they are excluded? -- Cecil Westerhof

[sqlite] Working with booleans

2016-04-14 Thread Cecil Westerhof
2016-04-14 19:49 GMT+02:00 Jay Kreibich : > > On Apr 14, 2016, at 12:42 PM, Cecil Westerhof > wrote: > > > When working with booleans at the moment I use: > >isActive INTEGER NOT NULL CHECK(isActive in (0, 1)) > > > > Is this a good way, or would be usi

[sqlite] Journal 4.6 KB, after commit database 6 or 7 KB bigger

2016-04-14 Thread Cecil Westerhof
2016-04-14 20:00 GMT+02:00 Richard Hipp : > On 4/14/16, Cecil Westerhof wrote: > > I have seen several times that the journal was 4.6 KB, but that fter > > committing the database had grown with 6 or 7 KB. No big problem, but I > > find it strange. What could be happening

[sqlite] Exclude NULL from index

2016-04-14 Thread Cecil Westerhof
2016-04-14 19:49 GMT+02:00 Dominique Devienne : > On Thu, Apr 14, 2016 at 7:48 PM, Cecil Westerhof > wrote: > > > If I would have a table where a lot of values are NULL. Would it be > > possible to exclude those records from the index? I would only search > for a > &

[sqlite] Using SQLite for storing photo's

2016-04-14 Thread Cecil Westerhof
2016-04-14 19:41 GMT+02:00 Simon Slavin : > > On 14 Apr 2016, at 6:37pm, Cecil Westerhof wrote: > > > I am thinking about storing my photo's in SQLite. > > Doesn't answer your question, but you should definitely read > > <https://www.sqlite.org/intern-v-extern-blob.

[sqlite] Checks with dates

2016-04-14 Thread Cecil Westerhof
. Is that possible to check? -- Cecil Westerhof

[sqlite] Working with UUID

2016-04-14 Thread Cecil Westerhof
writing a lot and crashing the database is changed instead off rolled back.) I am leaning to using blob's (or at least for join tables). Are there reasons to go for one or the another, or is it just individual taste and efficiency when needed? -- Cecil Westerhof

[sqlite] Primary key values can be NULL

2016-04-14 Thread Cecil Westerhof
the value NULL? -- Cecil Westerhof

[sqlite] Checks with dates

2016-04-14 Thread Cecil Westerhof
2016-04-14 21:26 GMT+02:00 Richard Hipp : > On 4/14/16, Cecil Westerhof wrote: > > I have a table where I have two fields: toStart and finishBefore. They > are > > both dates and when filled the format should be %Y-%m-%d. How can this be > > checked? 2016-04-3

[sqlite] Primary key values can be NULL

2016-04-14 Thread Cecil Westerhof
2016-04-14 21:46 GMT+02:00 Richard Hipp : > On 4/14/16, Cecil Westerhof wrote: > > For example a database with partial tables can not be read with a > > SQLite before 3.8.0. So why is SQLite not changed so primary keys can not > > have the value NULL? > > You

[sqlite] Using SQLite for storing photo's

2016-04-14 Thread Cecil Westerhof
2016-04-14 21:37 GMT+02:00 Simon Slavin : > > On 14 Apr 2016, at 8:10pm, Cecil Westerhof wrote: > > > ?I would like to have everything in one file. > > From previous discussions on this list, what you want to do will work > fine. Of course you should make sure your

[sqlite] Using SQLite for storing photo's

2016-04-14 Thread Cecil Westerhof
2016-04-14 22:07 GMT+02:00 Clemens Ladisch : > Cecil Westerhof wrote: > > what is the best way to make a backup? > > With the backup API: <http://www.sqlite.org/backup.html>. > (Also available as .backup in the shell.) > ?I should be more precise in my communication

[sqlite] Primary key values can be NULL

2016-04-14 Thread Cecil Westerhof
2016-04-14 22:10 GMT+02:00 Richard Hipp : > On 4/14/16, Cecil Westerhof wrote: > > > > ?Yes that makes sense. But could not a type of PRAGMA be used? So if the > > PRAGMA is not defined the old functionality and your historical data is > > save. And if the PRAGMA is de

[sqlite] Primary key values can be NULL

2016-04-15 Thread Cecil Westerhof
R Smith wrote: > > > > > > On 2016/04/14 10:23 PM, Cecil Westerhof wrote: > >> > >> 2016-04-14 22:10 GMT+02:00 Richard Hipp : > >> > >>> On 4/14/16, Cecil Westerhof wrote: > >>>> > >>>> Yes that makes sense. But could

[sqlite] Primary key values can be NULL

2016-04-15 Thread Cecil Westerhof
ite, because it is the standard.? -- Cecil Westerhof

[sqlite] Checks with dates

2016-04-15 Thread Cecil Westerhof
TEXT CHECK(ds IS NULL OR COALESCE(DATE(ds) == ds, 0)), de TEXT CHECK(de IS NULL OR COALESCE(DATE(de) == de, 0)), CHECK(ds IS NULL OR de IS NULL OR ds < de) ) And this does what I want. Thanks. -- Cecil Westerhof

[sqlite] Working with UUID

2016-04-15 Thread Cecil Westerhof
2016-04-15 8:45 GMT+02:00 Dominique Devienne : > On Thu, Apr 14, 2016 at 9:30 PM, Cecil Westerhof > wrote: > > > I want to work with UUID's. (Version 4.) > > > Honestly, your post is a little vague. But maybe the following will help. > ?I am not always ve

[sqlite] Primary key values can be NULL

2016-04-15 Thread Cecil Westerhof
2016-04-15 16:43 GMT+02:00 R Smith : > > > On 2016/04/15 2:09 PM, Cecil Westerhof wrote: > >> If you go to: >> https://www.sqlite.org/lang_createtable.html >> >> You will find: >> According to the SQL standard, PRIMARY KEY should always

[sqlite] Working with UUID

2016-04-15 Thread Cecil Westerhof
2016-04-15 19:47 GMT+02:00 Dominique Devienne : > On Fri, Apr 15, 2016 at 3:56 PM, Cecil Westerhof > wrote: > > > 2016-04-15 8:45 GMT+02:00 Dominique Devienne : > > > On Thu, Apr 14, 2016 at 9:30 PM, Cecil Westerhof < > cldwesterhof at gmail.com>> > >

[sqlite] Primary key values can be NULL

2016-04-15 Thread Cecil Westerhof
2016-04-15 20:10 GMT+02:00 John McKown : > On Fri, Apr 15, 2016 at 1:00 PM, Cecil Westerhof > wrote: > ?? > > > > > > ?I do not think it is. When you add something to the database to signify > > that a primary key is not allowed to be NULL, then this is

[sqlite] Primary key values can be NULL

2016-04-15 Thread Cecil Westerhof
t; moment of time). >> > > That's great news :) > Let me just note that we do not really shun the likes of Postgress, MSSQL, > MySQL etc. - those systems answer a different need. ?Me neither, but when SQLite is enough why add the complications of the other type of database? At my work they use DB2: I do not think SQLite would be a good replacement there. :-D ? ?I use it for logging. It is much easier to find something, or delete the parts you do not need anymore. Thanks for the patience. -- Cecil Westerhof

[sqlite] Primary key values can be NULL

2016-04-15 Thread Cecil Westerhof
2016-04-15 22:36 GMT+02:00 Cecil Westerhof : > ?I use it for logging. It is much easier to find something, or delete the > parts you do not need anymore. > An example: https://www.linkedin.com/pulse/use-bash-store-disc-info-sqlite-cecil-westerhof If I could do things better: le

[sqlite] Caveat entry

2016-04-16 Thread Cecil Westerhof
idea to add a caveat entry at: www.sqlite.org/about.html Somewhere in the beginning of the menu and with a font and colour that will spring out, so it would be reasonably certain that people fall for differences between regular databases and SQLite. -- Cecil Westerhof

[sqlite] Is it possible that dropping a big table takes very long

2016-04-16 Thread Cecil Westerhof
' AND LENGTH(UUID) = 16 AND SUBSTR(HEX(UUID), 13, 1) == '4' AND SUBSTR(HEX(UUID), 17, 1) IN ('8', '9', 'A', 'B') ) ); -- Cecil Westerhof

[sqlite] Is it possible that dropping a big table takes very long

2016-04-16 Thread Cecil Westerhof
2016-04-16 14:51 GMT+02:00 Simon Slavin : > > On 16 Apr 2016, at 10:59am, Cecil Westerhof > wrote: > > > I first had a table with 1E8 elements. When > > trying to drop this it looked like SQLite got hung. > > Please tell us which version of SQLite and which journal

[sqlite] Is it possible that dropping a big table takes very long

2016-04-16 Thread Cecil Westerhof
2016-04-16 14:52 GMT+02:00 R Smith : > > > On 2016/04/16 11:59 AM, Cecil Westerhof wrote: > >> I am playing a bit with SQLite. I first had a table with 1E8 elements. >> When >> trying to drop this it looked like SQLite got hung. I tried it from DB >> Browser

[sqlite] Can autocommit create smaller files

2016-04-16 Thread Cecil Westerhof
When filling a table with 10.000 records the file is 501 KB without auto commit and 500 KB with auto commit. Not a big difference, but I am intrigued: can auto commit result in smaller SQLite files? Is with Java and SQLite 3.8.11. -- Cecil Westerhof

[sqlite] Is it possible that dropping a big table takes very long

2016-04-16 Thread Cecil Westerhof
t is not well explained. Try just > > PRAGMA journal_mode; > ?That gives delete. -- Cecil Westerhof

[sqlite] Can autocommit create smaller files

2016-04-16 Thread Cecil Westerhof
2016-04-16 15:44 GMT+02:00 Cecil Westerhof : > When filling a table with 10.000 records the file is 501 KB without auto > commit and 500 KB with auto commit. Not a big difference, but I am > intrigued: can auto commit result in smaller SQLite files? > > Is with Java an

[sqlite] Is it possible that dropping a big table takes very long

2016-04-16 Thread Cecil Westerhof
2016-04-16 16:00 GMT+02:00 R Smith : > > > On 2016/04/16 3:39 PM, Cecil Westerhof wrote: > >> 2016-04-16 14:52 GMT+02:00 R Smith : >> >>-- 2016-04-16 14:44:55.054 | [Success]Script Success. >>> >>> As you can see, the INSERT obviousl

  1   2   3   4   >