[sqlite] Database speed comparison

2020-01-10 Thread Cecil Westerhof
I ran across this page: https://sqlite.org/speed.html It is a 'bit' outdated. (It uses 2.7.6.) Where can I find the scripts? And would it be a lot of work to update them and regularly rerun them? If it is manageable I would not mind to provide regularly updates. -- Cecil

Re: [sqlite] When not using threads: should I switch to single-thread mode

2019-12-27 Thread Cecil Westerhof
Op vr 27 dec. 2019 om 17:01 schreef Simon Slavin : > On 27 Dec 2019, at 3:06pm, Cecil Westerhof wrote: > > > My applications only use one thread (for the db stuff). Would it be a > good idea to switch to single-thread mode, or does that not give a real > performance improvement

[sqlite] When not using threads: should I switch to single-thread mode

2019-12-27 Thread Cecil Westerhof
when I switch to multiple threads. Maybe a good idea to add something about that at: https://www.sqlite.org/threadsafe.html -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin

Re: [sqlite] [EXTERNAL] Only enter higher values in table

2019-12-27 Thread Cecil Westerhof
not expect to insert records from the past), but I also add that it will not be higher as record from a later date. -Ursprüngliche Nachricht- > Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > Im Auftrag von Cecil Westerhof > Gesendet: Freitag, 27. D

[sqlite] Only enter higher values in table

2019-12-27 Thread Cecil Westerhof
toComplete FROM rawSummaryUdemy ; If this can be done better: let me know. Normally speaking total and completed should never decrease. It is not really important, but just as an exercise: is it possible to add constraints so that you cannot enter a total, or a completed tha

[sqlite] Is this rewrite of a query OK

2019-01-25 Thread Cecil Westerhof
, Maximum , Maximum - Minimum AS Range FROM ( SELECT MIN(totalUsed) AS Minimum , MAX(totalUsed) AS Maximum FROM quotes ) Is this acceptable, or could there be unintended consequences? Is there a better way to do it? -- Cecil Westerhof

[sqlite] Conditional lowering of value

2019-01-04 Thread Cecil Westerhof
h in programming code, but I was wondering if this could be done with a SQL statement. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] wal-mode and checkpoint

2018-09-02 Thread Cecil Westerhof
2018-09-02 17:31 GMT+02:00 Simon Slavin : > On 2 Sep 2018, at 2:43pm, Cecil Westerhof wrote: > > > When I do in sqlitebrowser: > >PRAGMA TABLE_INFO(messages) > > Just for peace of mind, since you are reporting unexpected behaviour, > please run an integrity_check.

[sqlite] wal-mode and checkpoint

2018-09-02 Thread Cecil Westerhof
database. So I added a checkpoint to the end of my programs also. Any idea why this happens? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] [O] A strange problem with org-babel and SQLite

2018-08-31 Thread Cecil Westerhof
Oops, wrong group. Sorry. :'-( 2018-08-31 12:21 GMT+02:00 Cecil Westerhof : > 2018-08-31 11:17 GMT+02:00 Robert Klein : > >> Hi Cecil, >> >> On Fri, 31 Aug 2018 10:47:50 +0200 >> Cecil Westerhof wrote: >> >> > I have a strange problem with org-

Re: [sqlite] [O] A strange problem with org-babel and SQLite

2018-08-31 Thread Cecil Westerhof
2018-08-31 11:17 GMT+02:00 Robert Klein : > Hi Cecil, > > On Fri, 31 Aug 2018 10:47:50 +0200 > Cecil Westerhof wrote: > > > I have a strange problem with org-babel and SQLite. > > > > I have a database that is created with: > > CREATE TABLE &quo

Re: [sqlite] Better way to get range of dates

2018-08-29 Thread Cecil Westerhof
more efficient. ;-) > sqlite> select x from x where x between 1 and 10; > QUERY PLAN > I should learn to read QUERY PLAN's. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sql

[sqlite] Better way to get range of dates

2018-08-29 Thread Cecil Westerhof
, '-1 days') Is there a preferred way? In a way I like the second better. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Get data in one query

2018-08-29 Thread Cecil Westerhof
roblems with date + time when the clock is set back. That is why I do my statistics after two in the morning. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Get data in one query

2018-08-29 Thread Cecil Westerhof
2018-08-29 21:26 GMT+02:00 Wout Mertens : > By the way, why not store the time as epoch? Date and time in one... > Because I think it is better to have date and time as different (text) fields. -- Cecil Westerhof ___ sqlite-users mailing list

Re: [sqlite] Get data in one query

2018-08-29 Thread Cecil Westerhof
2018-08-29 18:58 GMT+02:00 Cecil Westerhof : > 2018-08-29 18:06 GMT+02:00 R Smith : > >> >> SELECT SUM(Tot) AS Tot, SUM(Late) AS Late >> FROM (SELECT 1 AS Tot, (time NOT LIKE '%:00') AS Late >> FROM messages >> WHERE date = DAT

Re: [sqlite] Get data in one query

2018-08-29 Thread Cecil Westerhof
FROM messages WHERE date = DATE('now') ) ) > On 2018/08/29 5:56 PM, Cecil Westerhof wrote: > >> I have a table messages in which something is put every minute. The total >> messages that are added today I can get with: >> SELECT COUN

[sqlite] Get data in one query

2018-08-29 Thread Cecil Westerhof
I can get with: SELECT COUNT(*) AS Late FROM messages WHERE date = DATE('now') AND time NOT LIKE '%:00' Is there a way to get this information in one query? -- Cecil Westerhof ___ sqlite-users mailing list sqlite

Re: [sqlite] Ssubstitution in Tcl goes sometimes wrong Posted

2018-07-30 Thread Cecil Westerhof
2018-07-30 20:39 GMT+02:00 Cecil Westerhof : > I described the problem here: > http://paste.tclers.tk/4800 > The solution is a CAST: AND Temperature > CAST(:tempAbove AS real) -- Cecil Westerhof ___ sqlite-users mailing

[sqlite] Ssubstitution in Tcl goes sometimes wrong Posted

2018-07-30 Thread Cecil Westerhof
I described the problem here: http://paste.tclers.tk/4800 -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Correct way for INSERT OR REPLACE and COMMIT

2018-07-19 Thread Cecil Westerhof
2018-07-19 11:37 GMT+02:00 R Smith : > On 2018/07/19 8:35 AM, Cecil Westerhof wrote: > >> I have the following Tcl code: >> set rollback " >> INSERT OR REPLACE INTO pipRollback >> (pipType, package, old, new) >> VALUES >> (

[sqlite] Correct way for INSERT OR REPLACE and COMMIT

2018-07-18 Thread Cecil Westerhof
${doAppend}} { append packages "${package} " db eval ${rollback} } } db eval {COMMIT TRANSACTION} I suppose it is the correct way, but is there something I should change? -- Cecil Westerhof ___ sqlite-users

Re: [sqlite] Lowering totalUsed

2018-07-12 Thread Cecil Westerhof
2018-07-12 9:30 GMT+02:00 Cecil Westerhof : > A few tables have a not completely apt named column totalUsed. > > It is used to see which records are more used as other records and give > the less used records a bigger chance of being selected. When the numbers > become high I do

[sqlite] Lowering totalUsed

2018-07-12 Thread Cecil Westerhof
(totalUsed) FROM tips) + 1 I am not quit happy with this. Would it be better to split it in two queries and feed the result of the first to the second? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http

Re: [sqlite] [EXTERNAL] What happens when a call contains two SQL statement

2018-07-08 Thread Cecil Westerhof
users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > Im Auftrag von Cecil Westerhof > Gesendet: Montag, 09. Juli 2018 08:21 > An: SQLite mailing list > Betreff: [EXTERNAL] [sqlite] What happens when a call contains two SQL > statement > > I am working with Tcl. The best is of-cour

[sqlite] What happens when a call contains two SQL statement

2018-07-08 Thread Cecil Westerhof
sting (key, value) VALUES (12, 'Just some text') " db eval ${sqlCmd} If the insert goes wrong, will the delete be rolled back, or not? I could use INSERT OR REPLACE, but the above code would be database independent.

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
2018-07-08 11:00 GMT+02:00 Cecil Westerhof : > 2018-07-08 8:19 GMT+02:00 Cecil Westerhof : > >> I thought there was a problem with RANDOM. I used: >> ,ABS(RANDOM()) / CAST(1.4E18 AS INTEGER) AS Randomiser >> >> And it seemed I got a lot of thre

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
2018-07-08 8:19 GMT+02:00 Cecil Westerhof : > I thought there was a problem with RANDOM. I used: > ,ABS(RANDOM()) / CAST(1.4E18 AS INTEGER) AS Randomiser > > And it seemed I got a lot of threes. > > To check this I used: > SELECT Randomiser > ,

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
sqlite-users [mailto:sqlite-users- > >boun...@mailinglists.sqlite.org] On Behalf Of Cecil Westerhof > >Sent: Sunday, 8 July, 2018 02:16 > >To: SQLite mailing list > >Subject: Re: [sqlite] Kind of pivot table > > > >2018-07-08 9:10 GMT+02:00 Keith Medcalf : > &

Re: [sqlite] Kind of pivot table

2018-07-08 Thread Cecil Westerhof
when I try the first statement I get​: Error: no such table: generate_series Am I overlooking something? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] To JSON or not to JSON

2018-07-08 Thread Cecil Westerhof
quote (with extra line(s)) and lastUsed. Is this an acceptable way to implement it, or would it be better to unravel the elements in different records? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Kind of pivot table

2018-07-07 Thread Cecil Westerhof
rs [mailto:sqlite-users- > >boun...@mailinglists.sqlite.org] On Behalf Of Cecil Westerhof > >Sent: Sunday, 8 July, 2018 00:44 > >To: SQLite mailing list > >Subject: Re: [sqlite] Kind of pivot table > > > >2018-07-08 8:19 GMT+02:00 Cecil Westerhof : > > > >> I thought the

Re: [sqlite] Kind of pivot table

2018-07-07 Thread Cecil Westerhof
2018-07-08 8:19 GMT+02:00 Cecil Westerhof : > I thought there was a problem with RANDOM. I used: > ,ABS(RANDOM()) / CAST(1.4E18 AS INTEGER) AS Randomiser > > And it seemed I got a lot of threes. > > To check this I used: > SELECT Randomiser > ,

[sqlite] Kind of pivot table

2018-07-07 Thread Cecil Westerhof
uot;3""165727" "4""165619" "5""165749" "6""98042" So 6 is created less often as 0 - 5, but that is in my use case not a problem. This worked for me because I have a big table CPUUsage. But if I would

Re: [sqlite] Automatic numbering

2018-07-07 Thread Cecil Westerhof
2018-07-07 14:57 GMT+02:00 Simon Slavin : > On 7 Jul 2018, at 12:04pm, Cecil Westerhof wrote: > > > ​I went for the following solution: > >UPDATE > ​​ > ​​ > selectRandom > >SETlastUsed= DATE('now', 'localtime') >

Re: [sqlite] Automatic numbering

2018-07-07 Thread Cecil Westerhof
2018-07-05 5:37 GMT+02:00 Simon Slavin : > On 5 Jul 2018, at 3:22am, Cecil Westerhof wrote: > > > I only want to store a date with a record. But it is possible that more > as > > one record will be inserted, so I want to use another field to use as an > > index. So

Re: [sqlite] Automatic numbering

2018-07-04 Thread Cecil Westerhof
2018-07-05 5:37 GMT+02:00 Simon Slavin : > On 5 Jul 2018, at 3:22am, Cecil Westerhof wrote: > > > I only want to store a date with a record. But it is possible that more > as > > one record will be inserted, so I want to use another field to use as an > > index. So

[sqlite] Automatic numbering

2018-07-04 Thread Cecil Westerhof
highest index and increase this with one? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] 'Best' way to create calculated field

2018-06-20 Thread Cecil Westerhof
(totalUsed) AS Maximum , MAX(totalUsed) - MIN(totalUsed) AS Range FROM quotes ​Or is there a reason to go for the second query, or even a total different query?​ -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Check Constraint

2018-06-12 Thread Cecil Westerhof
2018-06-12 12:38 GMT+02:00 Clemens Ladisch : > Cecil Westerhof wrote: > > I want to create a field that only has values that consist of letters, > > numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. > > What is the best way to

[sqlite] Check Constraint

2018-06-12 Thread Cecil Westerhof
I want to create a field that only has values that consist of letters, numbers end '-'. So no spaces, quotes or special characters like: '@%$!'. What is the best way to write this check constraint? -- Cecil Westerhof ___ sqlit

Re: [sqlite] This list is getting spammed again

2018-05-11 Thread Cecil Westerhof
2018-05-11 11:12 GMT+02:00 Cecil Westerhof : > 2018-05-10 1:09 GMT+02:00 Simon Slavin : > >> >> >> On 9 May 2018, at 9:37pm, Cecil Westerhof wrote: >> >> > ​I am bitten by it also now. I posted a question and within two minutes >> I >> >

Re: [sqlite] This list is getting spammed again

2018-05-11 Thread Cecil Westerhof
2018-05-10 1:09 GMT+02:00 Simon Slavin : > > > On 9 May 2018, at 9:37pm, Cecil Westerhof wrote: > > > ​I am bitten by it also now. I posted a question and within two minutes I > > got a spam message​ > > I got three or four of these, each one soon after I'd pos

Re: [sqlite] This list is getting spammed again

2018-05-09 Thread Cecil Westerhof
2018-05-08 9:37 GMT+02:00 Domingo Alvarez Duarte : > Again this list is getting spammed, I just received spam after publish. > ​I am bitten by it also now. I posted a question and within two minutes I got a spam message​ ​that pretended to be a reply on my message.​ -- Cecil Wes

[sqlite] Only see unused when there are unused records

2018-05-09 Thread Cecil Westerhof
used' AS Type ,COUNT(*)AS NoUsed FROM quotes WHEREtotalUsed == 'unused' UNION ALL SELECT 'Total' AS Type ,COUNT(*) AS NoUsed FROM quotes ) WHERENoUsed > 0 Is this correct, or

Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-18 Thread Cecil Westerhof
You might compute this using: > >sqlite3 yourfile.db '.schema --indent' | grep -i autoincrement | wc -l > ​A lot less as I thought: 0 5 0 0 0 0 0 0 0 2 0 2 0 0 0 1 0 0 0 -- Cecil Westerhof ___ sqlite-users mailing list sqli

Re: [sqlite] Why this LIMIT

2018-03-11 Thread Cecil Westerhof
2018-03-11 9:49 GMT+01:00 Clemens Ladisch : > Cecil Westerhof wrote: > > I see that in certain older queries I use: > > LIMIT (SELECT COUNT(*) FROM TABLE) > > > > ​It looks like​ this has no use (limiting the selected records to the > > number of records ther

[sqlite] Need two ORDER two times when using RANDOM

2018-03-10 Thread Cecil Westerhof
t;"15.580638189131""2.0146022387495" "Zoals het klokje thuis tikt, tikt het nergens.""2017-01-18""8.53059705262686" "15.7307229942""1.1516802288132" So randomiser is not stable any-more. For t

[sqlite] Why this LIMIT

2018-03-10 Thread Cecil Westerhof
I see that in certain older queries I use: LIMIT (SELECT COUNT(*) FROM TABLE) ​It looks like​ this has no use (limiting the selected records to the number of records there are). Anyone an idea what could be a reason for this? -- Cecil Westerhof

Re: [sqlite] Tee to a table

2018-02-01 Thread Cecil Westerhof
ndex, content) VALUES ($index, > $content);} > } > db close > ​Looks promising.​ The 'problem' is that I get a record pro line. But that is not a big problem I think. On the plus side it is easy to make a GUI instead of a command line version. Thanks. > On 2/1/18, 2:25 PM,

Re: [sqlite] Tee to a table

2018-02-01 Thread Cecil Westerhof
2018-02-01 21:42 GMT+01:00 Simon Slavin : > On 1 Feb 2018, at 8:25pm, Cecil Westerhof wrote: > > > At the moment I have a script where I send the output of a ffmpeg command > > to the terminal and a file. Is it possible to send the output to a SQLite > > table. I like to

[sqlite] Tee to a table

2018-02-01 Thread Cecil Westerhof
At the moment I have a script where I send the output of a ffmpeg command to the terminal and a file. Is it possible to send the output to a SQLite table. I like to use tcl for this. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users

[sqlite] Check if SQLite Databases Are Locked

2018-01-22 Thread Cecil Westerhof
here: https://wiki.tcl.tk/54781 -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Can this be done with SQLite

2018-01-22 Thread Cecil Westerhof
problem domain other than that covered > by the example, and your referential constraints are inadequate to ensure > integrity for your limited example. > ​I think I can solve it generally. I will look into it and share it here. ​ > >-Original Message- > >From: sqlit

Re: [sqlite] Can this be done with SQLite

2018-01-22 Thread Cecil Westerhof
thinking I am going to do it programmatically​. Maybe write a general function for it. Everyone thanks for the fast replies. > -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > On Behalf Of Cecil Westerhof > Sent: Monday, Januar

Re: [sqlite] Can this be done with SQLite

2018-01-22 Thread Cecil Westerhof
2018-01-22 23:07 GMT+01:00 Igor Tandetnik : > On 1/22/2018 4:36 PM, Cecil Westerhof wrote: > >> >> When I do this, I get: >> sqlite> SELECT * >> ...> FROM playYouTubeVideo >> ...> WHERE key BETWEEN '1' AND '5' >&

Re: [sqlite] Can this be done with SQLite

2018-01-22 Thread Cecil Westerhof
key '3'. >> ​- The value by key '3' becomes the value by key '4'. >> - The value by key '4' becomes the value by key '5'. >> - The value by key '5' becomes the value by key '6'. >> >> ​I suppose that

Re: [sqlite] Can this be done with SQLite

2018-01-22 Thread Cecil Westerhof
playYouTubeVideo ...> WHERE key BETWEEN '1' AND '5' ...> ; 1|2.0 2|3.0 3|4.0 4|5.0 5|2.0 But I want the last one needs to be 1.0. Also, when the range becomes big, it will be a lot of code. I was hoping I overlooked a smart trick, but I probably need to do it pr

[sqlite] Can this be done with SQLite

2018-01-22 Thread Cecil Westerhof
'5' becomes the value by key '6'. ​I suppose that I need to do this programmatically, or can this be done with SQL? And optionally also: ​- The value by key '1' becomes the value by key '5'. ​ -- Cecil Westerhof ___

[sqlite] Tcl script to get temperature statistics

2017-12-20 Thread Cecil Westerhof
|70 -+-- SubTotal | 398 -+-- 42.0 |96 41.5 | 161 41.0 |96 40.5 | 8 -+-- SubTotal | 361 -+-- Total | 1440 -+-- If

[sqlite] sqlite3_analyzer for Debian

2017-12-07 Thread Cecil Westerhof
I was looking at: Tcl'2017 - SQLite's use of Tcl (Richard Hipp) There is talk about the sqlite3_analyzer. But I do not have this on my Debian system. Is that only for Windows? -- Cecil Westerhof ___ sqlite-users mailing list sq

Re: [sqlite] How to store as integer

2017-12-06 Thread Cecil Westerhof
2017-12-06 15:46 GMT+01:00 Peter Da Silva : > I’d recommend expr {double($temp)} so the bytecode compiler can optimize > the expression. > > On 12/6/17, 8:40 AM, "sqlite-users on behalf of Cecil Westerhof" < > sqlite-users-boun...@mailinglists.sqlite.org on behalf

Re: [sqlite] How to store as integer

2017-12-06 Thread Cecil Westerhof
2017-12-06 14:58 GMT+01:00 Simon Slavin : > > > On 6 Dec 2017, at 1:19pm, Cecil Westerhof wrote: > > >message NOT NULL > > Given thqt you want the "message" stored as REAL, you should be defining > this column as REAL. This is necessary, tho

Re: [sqlite] How to store as integer

2017-12-06 Thread Cecil Westerhof
} > > } > > # Not really necessary because the above loop never ends > > # But I find this more clear and is robuster against change > > db close > > > > If I enter: > > SELECT date > > , message > > ,

[sqlite] How to store as integer

2017-12-06 Thread Cecil Westerhof
type = 'cpu-temp' AND date = '2017-12-06' I see that the temperature is saved as text. In the past I had a script like this in Python who would save the temperature as real. What do I need to change to let this script save it as real also? -- Cecil Westerhof ___

Re: [sqlite] Good resources for TCL/TK

2017-12-04 Thread Cecil Westerhof
2017-12-04 14:33 GMT+01:00 Cecil Westerhof : > > > 2017-11-19 23:00 GMT+01:00 jungle boogie : > >> Thus said Cecil Westerhof on Sat, 18 Nov 2017 14:43:23 +0100 >> >>> I found the benefits for TCL/TK. But this is a SQLite mailing list, so >>> not >>

Re: [sqlite] Good resources for TCL/TK

2017-12-04 Thread Cecil Westerhof
gs --show}} or: exec swapon {--noheadings --show} swapon: unrecognized option '--noheadings --show' ​ On Dec 4, 2017 8:27 AM, "Cecil Westerhof" wrote: > > > 2017-12-04 15:24 GMT+01:00 Gerry Snyder : > > > > > It is always a good idea to put the argumen

Re: [sqlite] Good resources for TCL/TK

2017-12-04 Thread Cecil Westerhof
2017-12-04 15:24 GMT+01:00 Gerry Snyder : > It is always a good idea to put the arguments of [expr] in braces. That way > they are byte-compiled. > ​You mean like: exec {swapon} (--noheadings} {--show} -- Cecil Westerhof ___ sqlite-user

Re: [sqlite] Good resources for TCL/TK

2017-12-04 Thread Cecil Westerhof
2017-11-19 23:00 GMT+01:00 jungle boogie : > Thus said Cecil Westerhof on Sat, 18 Nov 2017 14:43:23 +0100 > >> I found the benefits for TCL/TK. But this is a SQLite mailing list, so not >> the right place to ask questions if it is not connected to SQLite also. >> What wou

Re: [sqlite] Good resources for TCL/TK

2017-11-18 Thread Cecil Westerhof
2017-11-18 15:14 GMT+01:00 Eric : > On Sat, 18 Nov 2017 14:43:23 +0100, Cecil Westerhof < > cldwester...@gmail.com> wrote: > > I found the benefits for TCL/TK. But this is a SQLite mailing list, so > not > > the right place to ask questions if it is not connected to SQL

[sqlite] Good resources for TCL/TK

2017-11-18 Thread Cecil Westerhof
I found the benefits for TCL/TK. But this is a SQLite mailing list, so not the right place to ask questions if it is not connected to SQLite also. What would be good resources for TCL/TK? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Starting with TCL

2017-11-17 Thread Cecil Westerhof
* ,abs(random()) / CAST(1.4E18 AS INTEGER) AS Randomiser FROM teaInStock ORDER BY LastUsed ) ORDER BY randomiser + IFNULL(JULIANDAY(LastUsed), 0) ASC LIMIT:limitNr " -- Cecil Westerhof

Re: [sqlite] Starting with TCL

2017-11-17 Thread Cecil Westerhof
2017-11-17 12:43 GMT+01:00 Cecil Westerhof : > I have the following: > set getLatestTeasStr { > SELECT Tea > FROM teaInStock > ORDER BY LastUsed DESC > LIMIT5 > ; > } > > But because I want to define the lim

Re: [sqlite] Starting with TCL

2017-11-17 Thread Cecil Westerhof
FROM teaInStock ORDER BY LastUsed DESC LIMIT? ; } ​In Java I would do something like: psSel.setInt(1, nrToFetch);​ ​How do I do this in TCL?​ -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Starting with TCL

2017-11-17 Thread Cecil Westerhof
​In Bash I can use: continue 2 ​to continue not the current loop, but the loop surrounding it. This does not work in TCL. Is there another way to do this? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http

Re: [sqlite] Starting with TCL

2017-11-17 Thread Cecil Westerhof
] \ [dict get [lindex $teaList ${i}] Tea] \ [dict get [lindex $teaList ${i}] LastUsed] \ [dict get [lindex $teaList ${i}] Location] \ [dict get [lindex $teaList ${i}] Randomiser]] incr i } This does what I want (I need the value

Re: [sqlite] Starting with TCL

2017-11-17 Thread Cecil Westerhof
2017-11-17 9:38 GMT+01:00 Dan Kennedy : > On 11/17/2017 03:20 PM, Cecil Westerhof wrote: > >> The folowing works: >> db eval ${getTeasToDrinkStr} { >> puts [format "%-30s %-10s %2s %d" ${Tea} ${Last Used} ${Location} >> ${Randomiser}] >>

Re: [sqlite] Starting with TCL

2017-11-17 Thread Cecil Westerhof
tead of an array. How do I get it filled as an array? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Starting with TCL

2017-11-16 Thread Cecil Westerhof
2017-11-17 5:38 GMT+01:00 Cecil Westerhof : > setsqliteVersion [sqlite3 -version] > ​By the way, I think it is a good idea to amend: https://sqlite.org/tclsqlite.html to show this possibility. -- Cecil Westerhof ___ sqlite-users m

Re: [sqlite] Starting with TCL

2017-11-16 Thread Cecil Westerhof
2017-11-16 22:20 GMT+01:00 Richard Hipp : > On 11/16/17, Cecil Westerhof wrote: > > ​Is it possible to get the library version before connecting to a > database? > > puts [sqlite -version] > ​Combining yours and Eric's version, I made: #!/usr/bin/env tclsh

Re: [sqlite] Starting with TCL

2017-11-16 Thread Cecil Westerhof
? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Starting with TCL

2017-11-16 Thread Cecil Westerhof
2017-11-16 18:44 GMT+01:00 Peter Da Silva : > > On 11/16/17, 11:37 AM, "sqlite-users on behalf of Cecil Westerhof" < > sqlite-users-boun...@mailinglists.sqlite.org on behalf of > cldwester...@gmail.com> wrote: > > When I use: > > db eval {SELECT *

[sqlite] Starting with TCL

2017-11-16 Thread Cecil Westerhof
aInStock} { puts $Tea, $Location }" I would like something like: Brandnetel 2017-11-16 1 Oolong 2017-10-29 2 Goudsbloem 2017-10-22 3 Jasmijn … And probably another complication: one of the columns is called: "Last Used". -- Cecil Westerhof

Re: [sqlite] How not to let random be calculated again and again and

2017-11-16 Thread Cecil Westerhof
2017-11-06 11:11 GMT+01:00 Cecil Westerhof : > 2017-11-06 10:39 GMT+01:00 Keith Medcalf : > >> >> The easiest way is likely to make the query so that it cannot be >> flattened by adding an ORDER BY (that does not reference the column >> containing the non-determinist

Re: [sqlite] How not to let random be calculated again and again and

2017-11-06 Thread Cecil Westerhof
m not sure in which programming language the real version will be implemented, but it will probably use a version near that one. For example my Java uses 3.20.0. > >-Original Message- > >From: sqlite-users [mailto:sqlite-users- > >boun...@mailinglists.sqlite.org] On Behal

[sqlite] How not to let random be calculated again and again and

2017-11-06 Thread Cecil Westerhof
uot;2458047.5" "2017-10-17""2" "5""2458048.5" "2017-10-20""3""1""2458048.5" Is there a way to generate Randomiser in such a way it is only calculated once pro record? -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
2017-09-07 0:57 GMT+02:00 Simon Slavin : > > > On 6 Sep 2017, at 11:31pm, Cecil Westerhof wrote: > > > 2017-09-07 0:20 GMT+02:00 Richard Hipp : > > > >> On 9/6/17, Cecil Westerhof wrote: > >> > >>> Maybe this is correct, but it is cert

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
2017-09-07 0:36 GMT+02:00 Wolfgang Enzinger : > Am Thu, 7 Sep 2017 00:28:56 +0200 schrieb Cecil Westerhof: > > > 2017-09-07 0:20 GMT+02:00 Wolfgang Enzinger : > > >> Add this trigger and everything is fine. ;-) > >> > >> CREATE TRIGGER weights_float_fo

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
YPEOF(float) IN ("real","integer")) ); Instead of "int" you need "integer". -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
2017-09-07 0:20 GMT+02:00 Richard Hipp : > On 9/6/17, Cecil Westerhof wrote: > > > > Maybe this is correct, but it is certainly confusing. > > > > The constraint check occurs before the implicit conversion. > ​Should that not be the other way around? But probably n

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
2017-09-07 0:20 GMT+02:00 Wolfgang Enzinger : > Am Thu, 7 Sep 2017 00:15:39 +0200 schrieb Cecil Westerhof: > > > 2017-09-07 0:05 GMT+02:00 R Smith : > > > >> On 2017/09/06 11:58 PM, R Smith wrote: > >> > >>> Your CHECK constraint should really fi

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
float) VALUES (0) The insert is successful of-course. When I then execute: SELECT float, TYPEOF(float) FROM testing I get: "0.0" "real" Maybe this is correct, but it is certainly confusing. -- Cecil Westerhof ___ sqlite-users ma

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
2017-09-06 23:58 GMT+02:00 R Smith : > On 2017/09/06 11:37 PM, Cecil Westerhof wrote: > >> But should in the first case the 0 not be cast to a 0.0? >> > > What makes you believe SQLite should massage the data into specific types > for you without you requesting

Re: [sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
2017-09-06 23:49 GMT+02:00 Jens Alfke : > > > > On Sep 6, 2017, at 2:37 PM, Cecil Westerhof > wrote: > > > > But should in the first case the 0 not be cast to a 0.0? > > No, SQLite ignores column type declarations. There's a whole article on > the web

[sqlite] Should the INTEGER not be cast to a REAL

2017-09-06 Thread Cecil Westerhof
ing (float) VALUES (0.0) I get: Query executed successfully But should in the first case the 0 not be cast to a 0.0? I do this in DBBrowser which uses 3.15.2. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlit

Re: [sqlite] Sharing data between desktop and Android

2017-09-06 Thread Cecil Westerhof
2017-09-06 12:54 GMT+02:00 Andy Ling : > > Cecil Westerhof wrote: > > > I am thinking about writing some Android applications. I would like to > > > share data between the phone (or tablet) and de desktop. What is the > best > > > way to do this? In a way tha

Re: [sqlite] Sharing data between desktop and Android

2017-09-06 Thread Cecil Westerhof
2017-09-06 12:01 GMT+02:00 Andy Ling : > Cecil Westerhof wrote: > > I am thinking about writing some Android applications. I would like to > > share data between the phone (or tablet) and de desktop. What is the best > > way to do this? In a way that would also be conven

Re: [sqlite] Is there a performance difference between COUNT(*) and COUNT(name)

2017-09-05 Thread Cecil Westerhof
2017-09-05 23:11 GMT+02:00 Simon Slavin : > > > On 5 Sep 2017, at 9:21pm, Cecil Westerhof wrote: > > > I want to know the number of teas I have in stock. For this I use: > > SELECT COUNT(Tea) > > FROM teaInStock > > > > Tea cannot be NULL, so this is

Re: [sqlite] Getting number of rows with NULL

2017-09-05 Thread Cecil Westerhof
t have NULL > values, so now I'm slightly lost and Stephen's interpretation seems more > sensible, but then the OP said that Igor's solution is working for him, > which should only work if there are NULL values... so yes, I am very much > confused as to exactly what goes on now

Re: [sqlite] Getting number of rows with NULL

2017-09-05 Thread Cecil Westerhof
way. ​Yes, your query is the better one. -- Cecil Westerhof ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

  1   2   3   4   >