Re: [sqlite] UPDATE statement without FROM clause

2016-06-05 Thread Keith Medcalf
You can simulate either a two-pass or one-pass UPDATE SET ... FROM , WHERE By doing one or the other of the following (depending on whether you want one-pass or two-pass). for a one-pass update: BEGIN IMMEDIATE; SELECT .rowid, FROM WHERE fetch a row UPDATE SET x=?, ... WHERE

Re: [sqlite] passing error messages to pysqlite

2014-10-03 Thread Keith Medcalf
Are you committing the change? >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of Mark Halegua >Sent: Friday, 3 October, 2014 20:58 >To: sqlite-users@sqlite.org >Subject: [sqlite] passing error messages to pysqlite > >I have

Re: [sqlite] passing error messages to pysqlite

2014-10-03 Thread Keith Medcalf
rr output and using an except there. >On Friday, October 03, 2014 11:35:08 PM you wrote: >> the sqlite3 command line doesn't require a commit, it gave an error >> after the attempted insert command. >> >> pysqlite requires one? >> >> Mark >> >> On

Re: [sqlite] passing error messages to pysqlite

2014-10-04 Thread Keith Medcalf
xt.SetValue(' ') > self.remarks_text.SetValue(' ') > > print 'dbupdated = ' , self.dbupdated > print self.add > self.add = False > print self.add > >sqlite3 version 3.7.4 > >Mark > > >On Friday,

Re: [sqlite] passing error messages to pysqlite

2014-10-04 Thread Keith Medcalf
t directory as the >> code, so this behavior is somehow wrong. >> >> The two systems I've tested this on are both Linux, one is kubuntu >11.04 >> with sqlite3 version 3.7.4 the otehr is Linux Mint 17, KDE, and sqlite3 >> version 3.8.2 >> >> I'm abo

Re: [sqlite] Sqlite giving error on unique constraint

2014-10-06 Thread Keith Medcalf
The table schema and insert statement might be useful ... On Monday, 6 October, 2014 14:42, Jeffrey Parker said: >I am working with sqlite3 in python 2.7.8 and I am running into a strange >error where I get the below exception when running an insert into >statement >on an

Re: [sqlite] In python, determine database status

2014-10-08 Thread Keith Medcalf
If you are not using explicit transactions are comitting them ... even agter a read to release the locks? Sent from Samsung Mobile Original message From: Mark Halegua Date:2014-10-08 16:12 (GMT-07:00) To: General Discussion of SQLite Database

Re: [sqlite] In python, determine database status

2014-10-08 Thread Keith Medcalf
thon, determine database status > >Um, do a commit after I do db.fetchone()? > >Mark > > >On Wednesday, October 08, 2014 07:26:01 PM Keith Medcalf wrote: >> If you are not using explicit transactions are comitting them ... even >agter >> a read to release the l

Re: [sqlite] Check if file exists in SQL syntax?

2014-10-10 Thread Keith Medcalf
You do not say what operating system, but for example, on Windows, the following function works: SQLITE_PRIVATE void _GetFileAttributes(sqlite3_context *context, int argc, sqlite3_value **argv) { sqlite3_result_int(context, GetFileAttributesW(sqlite3_value_text16(argv[0]))); } which is

Re: [sqlite] Lets try this again. Sqlite Python libraries throwing exception on unique constraint.

2014-10-13 Thread Keith Medcalf
And 2.7.8: Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> conn=sqlite3.connect(":memory:") >>> conn.execute(""" ... CREATE TABLE `UpdateFrom` ( ... `VersionName`

Re: [sqlite] Getting an unexpected result

2014-10-16 Thread Keith Medcalf
You said: select id, ProjID, PClass, PSubClass, bdate, lang, wDir From LSOpenJobs Where cust = 'PIPA' AND fromLang = 'EN-CA' AND (lang = 'DE-DE' OR lang = 'PT-BR') AND PSubClass LIKE '%-Trans' OR PSubClass Like '%-Valid' AND (PClass = 'Language' OR PClass =

Re: [sqlite] 'INTEGER PRIMARY KEY' start value

2014-10-19 Thread Keith Medcalf
for a table test(i integer primary key, j integer) the new i (rowid) is as follows: test.i = case when test.i is not null then test.i else case max(test.i) when null then 1 else max(test.i)+1 end end if you add the autoincrement keyword, then the algorithm becomes test.i = case when test.i

Re: [sqlite] Question on locks

2014-10-19 Thread Keith Medcalf
Actually, you should set the timeout for each connection. The computer does not matter. >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of Simon Slavin >Sent: Sunday, 19 October, 2014 18:35 >To: General Discussion of

Re: [sqlite] Data error

2014-10-19 Thread Keith Medcalf
That MSDN article only applies to 'System Restore'. System Restore does not do anything with "User Data" but only with "System Data". Of course, if you store "User Data" in a place where "System Data" is supposed to be stored, then your "User Data" is "System Data", not "User Data", and

Re: [sqlite] Full outer joins

2014-10-21 Thread Keith Medcalf
>It looks hairy but here's what it's doing. Given tables A,B: >1. Do the regular join (all rows with matches in both A and B) >2. Find rows in A that aren't in B >3. Find rows in B that aren't in A >4. Concatenate those 3 queries together with UNION ALL will be the same as A UNION ALL B, which

Re: [sqlite] Full outer joins

2014-10-21 Thread Keith Medcalf
Ooops. This can be further simplified as: select rowid from a where rowid not in b union all select rowid from b where rowid not in a; >>It looks hairy but here's what it's doing. Given tables A,B: > >>1. Do the regular join (all rows with matches in both A and B) >>2. Find rows in A that

Re: [sqlite] Index usage for order by and where clauses

2014-10-29 Thread Keith Medcalf
On Wednesday, 29 October, 2014 07:47, Clemens Ladisch said: >Baruch Burstein wrote: >> If I have an index on table1(colA, colB), will it be used for both the >> where and the order by in either of these cases: >> select * from table1 where colA=1 order by colB; >> select * from table1 where

Re: [sqlite] New kids on block the SQLite Master Suite.

2014-10-29 Thread Keith Medcalf
Microsoft takes special care in bug-for-bug compatibility, so win32 programs are pretty much guaranteed to run on any version of the OS that is equal or greater than the WINVER setting on which it was compiled. If it runs on W2K3 then it was compiled with WINVER set to 0x0502 (but perhaps was

Re: [sqlite] New kids on block the SQLite Master Suite.

2014-10-29 Thread Keith Medcalf
this fact until we purchase the license from >Microsoft. In the near future, I will try to make the program available >for the older version of Windows. >Best Regards, >B. Huynh > >From: sqlite-users-boun...@sqlite.org <sqlite-

Re: [sqlite] New kids on block the SQLite Master Suite.

2014-10-30 Thread Keith Medcalf
Does this set the _WIN32_WINNT and WINVER so the correct API set are included by windows.h / winnt.h? // Values of WINVER and _WIN32_WINNT for various minimum levels of Win32 Compatability // // WIN6 0x0600 W2K 0x0500 NT4 0x0400 // VISTA0x0600 WXP 0x0501

Re: [sqlite] New kids on block the SQLite Master Suite.

2014-10-30 Thread Keith Medcalf
ith-older-platform-toolset >Billy. > >From: sqlite-users-boun...@sqlite.org <sqlite-users-boun...@sqlite.org> >on behalf of Keith Medcalf <kmedc...@dessus.com> >Sent: Thursday, October 30, 2014 5:36 PM >To: General Discussion of SQLite Database >Subject: Re: [s

Re: [sqlite] x64 vs x32 DLL

2014-11-04 Thread Keith Medcalf
On Tuesday, 4 November, 2014 12:35, jose isaias cabrera asked: >I have an application that is written for x32 machines. However, we now >have a few machines that are x64 and all is well when we are using the >precompiled x32 DLLs provided by

Re: [sqlite] LEFT joins affect query plan for semantically equal queries

2014-11-05 Thread Keith Medcalf
On Wednesday, 5 November, 2014 05:14, vita...@yourcmc.ru said: >After playing a little with SQLite as a DBMS for Bugzilla, I've >discovered that LEFT/INNER join affects query plan in a bad way even for >semantically equal queries: >SELECT * FROM bugs b INNER JOIN profiles p ON

Re: [sqlite] What is the best alternative to this RIGHT OUTER JOIN ?

2014-11-08 Thread Keith Medcalf
How about the direct approach: SELECT uid FROM resource WHERE uid NOT IN (SELECT resource_uid FROM event_participant, event WHERE event_participant.event_uid = event.uid AND event.shift_uid = :shift_uid AND

Re: [sqlite] bug: "no such column" with UNION + subquery + GROUP BY + ORDER BY + COLLATE

2014-11-08 Thread Keith Medcalf
sqlite> select 1 union select 1 from (select 1 as x) group by x order by 1 collate binary; Error: no such column: x sqlite> select 1 from (select 1 as x) group by x; 1 sqlite> select 1 from (select 1 as x) group by x order by 1; 1 sqlite> select 1 from (select 1 as x) group by x order by 1

Re: [sqlite] What is the best alternative to this RIGHT OUTER JOIN ?

2014-11-08 Thread Keith Medcalf
On Saturday, 8 November, 2014 06:56, Tristan Van Berkom <tris...@upstairslabs.com> said: >On Sat, 2014-11-08 at 06:23 -0700, Keith Medcalf wrote: >> How about the direct approach: >> >> SELECT uid >> FROM resource >> WHERE uid NOT IN (SELECT re

Re: [sqlite] LEFT joins affect query plan for semantically equal queries

2014-11-08 Thread Keith Medcalf
On Wednesday, 5 November, 2014 22:23, James Lowden said: >On Wed, 05 Nov 2014 08:24:47 -0700, "Keith Medcalf" <kmedc...@dessus.com> >wrote: >> The two queries are different. They may end up with the same result, >> but you are asking different questions. In t

Re: [sqlite] Column name as a variable

2014-11-17 Thread Keith Medcalf
With the eval() function loaded, sqlite> select tbl_name, eval('select count(*) from ' || tbl_name) from sqlite_master where type='table'; advisory|10 advlink|67528 crew|144809 crewlink|1710151 genre|201 genrlink|703470 lineup|4 map|646 program|447534 role|14 schedule|162272 station|493

Re: [sqlite] Using Sqlite3 as a Change Time Recording Data Store in Glusterfs

2014-11-22 Thread Keith Medcalf
Your Glusterfs does not store modification times? Have you considered adding the modification time attribute to the inode directly? --- Theory is when you know everything but nothing works. Practice is when everything works but no one knows why. Sometimes theory and practice are combined:

Re: [sqlite] "database is locked" for SQLITE_BUSY

2014-12-03 Thread Keith Medcalf
>From https://www.sqlite.org/rescode.html#busy In both cases there are specific extended codes that may further pinpoint the source just in case you do not know what you are doing at the time the result code was returned. Interpretation is only difficult if you do not know what you are doing

Re: [sqlite] trying to store a file as a blob. caught on syntax...

2014-12-03 Thread Keith Medcalf
select writefile(name, contents) from files where name='filename.ext'; --- Theory is when you know everything but nothing works. Practice is when everything works but no one knows why. Sometimes theory and practice are combined: nothing works and no one knows why. >-Original

Re: [sqlite] Tags / keywords support?

2014-12-05 Thread Keith Medcalf
You probably want your "name" fields in each table to be declared name TEXT COLLATE NOCASE UNIQUE Your ImageTags should also have an index UNIQUE (TagID, ImageID) The AUTOINCREMENT keyword in each of the Images and Tags table is unnecessary. You also want fields containing the same thing to have

Re: [sqlite] How to Verify (know that they are correct) Queries in SQLite GUI Manager Firefox add-on?

2014-12-07 Thread Keith Medcalf
First, you have to "verify" that the database itself is sufficiently normalized and that it is anomoly free. This is a purely algebraic / mathematical operation and is a pre-requisite to any further verification. If the database is not properly normalized, or has other anomolous behaviour,

Re: [sqlite] Table names length and content

2014-12-08 Thread Keith Medcalf
You get a palladium star for avoiding the most obvious source of errors (and wasted keystrokes) ... --- Theory is when you know everything but nothing works. Practice is when everything works but no one knows why. Sometimes theory and practice are combined: nothing works and no one knows

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Keith Medcalf
update temp_table set id=(select id from some_table where c=42), operation='UPDATE' where exists (select 1 from some_table s where s.a=temp_table.a and s.b=temp_table.b and s.c=42); is the proper way of phrasing of a correlated subquery ... --- Theory is when you know everything but

Re: [sqlite] Artificially slow VACUUM by injecting a sleep() somewhere?

2014-12-08 Thread Keith Medcalf
Wanting is not needing. If a highly I/O bound process interferes with the I/O performed by other (not I/O bound) processes, then the OS is broken and the proper solution is to get a better O/S. These sorts of problems were solved back in the 60's (okay, maybe 70's). Therefore, unless a

Re: [sqlite] How do I update multiple rows in a single sql statement

2014-12-08 Thread Keith Medcalf
ite-users- >boun...@sqlite.org] On Behalf Of Igor Tandetnik >Sent: Monday, 8 December, 2014 18:32 >To: sqlite-users@sqlite.org >Subject: Re: [sqlite] How do I update multiple rows in a single sql >statement > >On 12/8/2014 8:20 PM, Keith Medcalf wrote: >> >> update temp_t

Re: [sqlite] recursive update

2014-12-15 Thread Keith Medcalf
with mt(a, b) as (select i, j from ...) update tab set x = (select a from mt where b = y) where y in (select y from mt); --- Theory is when you know everything but nothing works. Practice is when everything works but no one knows why. Sometimes theory and practice are combined: nothing

Re: [sqlite] recursive update

2014-12-15 Thread Keith Medcalf
That should be: with mt(a, b) as (select i, j from ...) update tab set x = (select a from mt where b = y) where y in (select b from mt); mt is a table/view (albeit a temporary one), so the update statement is no different than if you were updating the contents of one table from the

Re: [sqlite] Encrypted database

2014-12-16 Thread Keith Medcalf
>Most freely available encryption extensions use a hard coded encryption >method. This is true for System.Data.SQLite (128 bit RSA), SQLCipher >(256 bit AES), and wxSQLite3 (128 or 256 bit AES, decided at compile >time) to name a few. The official commercial SQLite Encryption Extension >(SEE)

Re: [sqlite] COMMIT nested in SELECT returns unexpected

2014-12-24 Thread Keith Medcalf
APSW does the same thing. I suspect that the commit operation is invalidating the select (since it is performed while the select is running) -- the effect of performing a commit in the middle of a running select (on the same connection) is (or should be) undefined. It will free the rollback

Re: [sqlite] Partial index to find maximum

2014-12-29 Thread Keith Medcalf
You should include both a and b in the index to be most helpful. CREATE INDEX whatever ON t (a, b); However, you say that (a, b) is already the primary key and therefore this index already exists and you do not need to create another one. Although the index will contain all rows, finding the

Re: [sqlite] Question regarding Sqlite In-Memory DB Insert

2015-01-01 Thread Keith Medcalf
I think either (a) your computer is broken; (b) your database is broken; or, (c) your methodology is broken. While I cannot speak to the inherent (ample) inefficiencies of dotnot, inserting three times the number of records (that is, ~1 million with multiple indexes) takes one-fifth the

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Keith Medcalf
The datetime() function takes an argument which represents a date and time string. The magic string 'now' equates to the computers concept of the current GMT time. This string, unless an additional modification is applied via the 'localtime' modifier, is always returned as a timestring in

Re: [sqlite] Client/Server Best Practices

2015-01-02 Thread Keith Medcalf
On Friday, 2 January, 2015 16:26, James K. Lowden said: >On Thu, 25 Dec 2014 05:32:45 -0700 (MST) Rick Kelly wrote: >> All SELECT type requests are wrapped with BEGIN TRANSACTION/COMMIT >That shouldn't be necessary and afaik isn't necessary.

Re: [sqlite] Time Zone Conversions

2015-01-07 Thread Keith Medcalf
The datetime function always returns GMT time unless you request it to do something else (for example, asking for a conversion to 'localtime' using the system c library concept of localtime and timezones -- which will almost always be incorrect on Windows since it has extremely limited

Re: [sqlite] Client/Server Best Practices

2015-01-07 Thread Keith Medcalf
On Wednesday, 7 January, 2015 20:01, James K. Lowden <jklow...@schemamania.org> said: >On Fri, 02 Jan 2015 21:41:02 -0700 >"Keith Medcalf" <kmedc...@dessus.com> wrote: >> On Friday, 2 January, 2015 16:26, James K. Lowden >> <jklow...@schemamania.org

Re: [sqlite] Client/Server Best Practices

2015-01-07 Thread Keith Medcalf
On Wednesday, 7 January, 2015 22:57, Kevin Benson said: >-- The OP wrote: >On Thu, Dec 25, 2014 at 7:32 AM, Rick Kelly wrote: >>*SNIP* >> The database file is located in the same folder as the server. The >server >is >> multi-threaded. I'm using

Re: [sqlite] Uncached performance

2015-01-08 Thread Keith Medcalf
>My database weights a little less than 2 Gbs and contains 130'000 keys. >When I put it on HDD and try to make 1 queries (extracting values for >1 different keys) with some additional processing of extracted >values, it takes about 4 seconds on my PC on any run except the first, >with

Re: [sqlite] Should .dump preserve foreign_keys pragma?

2015-01-08 Thread Keith Medcalf
It is correct. On the chance that you happen to have compiled your version of SQLite with Foreign Key enforcement turned on by default instead of off; or, a later versions decides to change the default to on rather than off; when you load a dump file you need to have that foreign key

Re: [sqlite] Scrolling Cursor implementation best practices (pagination and arbitrary sorting)

2015-01-08 Thread Keith Medcalf
The table you are creating is called a keyset snapshot. That is how all relational databases databases which support scrollable cursors implement them (only navigable databases -- hierarchical or network or network extended for example) support navigation within the database. Relational

Re: [sqlite] Support for millisecond

2015-01-08 Thread Keith Medcalf
You mean iso-8601 strings in the database? Yes, you can format the strings however you want (ie with an unlimited seconds precision). However, the internal datetime function only returns seconds (it is merely an alias for strftime using a format specifier that only outputs seconds), and if

Re: [sqlite] Client/Server Best Practices

2015-01-09 Thread Keith Medcalf
On Friday, 9 January, 2015 16:43, James K. Lowden <jklow...@schemamania.org> said: >On Wed, 07 Jan 2015 21:47:24 -0700 "Keith Medcalf" <kmedc...@dessus.com> wrote: >Along the same lines, since you mentioned it, >> in an SQLite database you can do:

Re: [sqlite] PK References One of Two Other Tables

2015-01-11 Thread Keith Medcalf
On Sunday, 11 January, 2015 11:22, Rich Shepard said: > Items to be raffled can be donated or purchased. The Donations and >Purchases tables each have the item ID as their PK. > The Raffles table should have the PK as either the Donations or the >Purchases item

Re: [sqlite] help with query

2015-01-13 Thread Keith Medcalf
A correlated subquery: select * from t where (select count(*) from t as b where b.data1 = t.data1) >= 3; or with a subselected set of valid rows: select * from t where data1 in (select data1 from t as b group by data1

Re: [sqlite] Huge WAL log

2015-01-16 Thread Keith Medcalf
Some data using python+apsw for 10,000,000 records: So, embeding the values in the SQL (ie, as text statements) and preparing a "new" statement each time is the least efficient, Multiple Values that are embedded in the SQL are more efficient, up to about 50/100 values per statement (50%

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Keith Medcalf
>>>I'm guess this is a case of the windows command-line shell doing some >>>character translations in the pipe, rather than just shipping the >>>bytes through the pipe unaltered. >> Ouch. That basically means the "pipe" method shouldn't ever be >> used on windows. >Not, at least, when your

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Keith Medcalf
On Friday, 16 January, 2015 14:05, Simon Slavin <slav...@bigfraud.org> said: >On 16 Jan 2015, at 9:01pm, Keith Medcalf <kmedc...@dessus.com> wrote: >>> Not, at least, when your database contains string data with unusual >>> characters that Windows feels like it

Re: [sqlite] sqlite3 tool bug

2015-01-16 Thread Keith Medcalf
>You have a system with a bunch of apps installed. You then upgrade to >a new version of the operating system and a whole bunch of the apps >break. Do you think people blame the apps or the operating system? >Do you think anyone takes the apps apart and blames them for using the >wrong apis

Re: [sqlite] sqlite3 shell in windows

2015-01-16 Thread Keith Medcalf
>I had the bright idea yesterday of trying to use an extension module in >Windows. I found myself a bit confused, and the messages and >documentation were not as helpful as they might have been. I suspect I >had a 32/64 bit mismatch in one case, and that sqlite3 wasn't compiled >with

Re: [sqlite] System.Data.SQLite - Exception Calling SQLiteModule.DeclareTable

2015-01-22 Thread Keith Medcalf
Probably for the same reason people exceed 8.3 filename limitations on Windows or try to embed non-alphanumeric characters in file/directory names (Including spaces and shell special characters) -- they have been told that they could do so and not told of the problems and difficulties created

Re: [sqlite] sqlite3 very slow even after creating without rowid

2015-01-24 Thread Keith Medcalf
You are using a WITHOUT ROWID table. Any particular reason why? Have you tried using an ordinary table? What type is your "TIME" field? Or did you mean TEXT but misspell it? Do you want the primary key columns to contain null, or is just defining things that are NOT NULL as being nullable

Re: [sqlite] Truncation of floating point numbers in SQLite?

2015-01-29 Thread Keith Medcalf
>I wonder what happens if you put SQLite on a computer with no native IEEE >maths library. Same as compiling with SQLITE_OMIT_FLOATING_POINT on a computer/compiler that *does* have floating point I should imagine -- you end up with a version of SQLite with all floating point omitted. ---

Re: [sqlite] Bug in SQLite FLOAT values

2015-02-07 Thread Keith Medcalf
Why would an application need to use the SQLite printf function to convert doubles to formatted text? The application ought to store and retrieve the raw doubles completely unadulterated (with no diddling, using the value_double and bind_double interfaces), and "format the value for display"

Re: [sqlite] Bug in SQLite FLOAT values

2015-02-08 Thread Keith Medcalf
A double precision floating point value contains about 14.5 to 16 digits of precision WHEN CONVERTED FROM BINARY TO DECIMAL TEXT. However, the double precision number is merely the closest binary approximation of a value as can be encoded in BINARY (base 2) format. Exact DEMAL (base 10)

Re: [sqlite] Multi-thread mode question

2015-02-08 Thread Keith Medcalf
And those mutexes around statement usage apply the mutex based on the underlying connection, not the statement (which is irrelevant)? --- Theory is when you know everything but nothing works. Practice is when everything works but no one knows why. Sometimes theory and practice are combined:

Re: [sqlite] ordinary CTE containing sum()

2015-02-09 Thread Keith Medcalf
Not exactly since aggregates are implemented as functions. In the case of sum(a + b + c) you have the overhead of one aggregate setup call, one call per row (after the three additions are done) and one finalizer call to retrieve the aggregate and release the context. In the case of sum(a) +

Re: [sqlite] 转发:SQLITE3 JOURNAL MODE

2015-02-10 Thread Keith Medcalf
>1) Keep it on the boot volume, not a network or external drive. >The following things will make your journal less safe: >1) PRAGMA data_store_directory to anywhere other than the boot volume I presume you mean "local filesystem" not "boot volume". The problem is that "remote" filesystems

Re: [sqlite] Fastest way to add many simple rows to a table?

2016-05-26 Thread Keith Medcalf
Take a look at the test_intarray.c/h extension located in the main source directory, it may just do what you want (the array of integers is stored in memory, but is accessed as a table). https://www.sqlite.org/src/artifact/870124b95ec4c645 > -Original Message- > From:

Re: [sqlite] Messages posted on Nabble not getting to list

2016-05-27 Thread Keith Medcalf
> I think there are two different use cases for a mailing list such as this, > and they're each better served by different access method; either email or > forums. > One use case is the individual with a long-term interest in a > project/technology. Because of the long-term interest, an email

Re: [sqlite] Messages posted on Nabble not getting to list

2016-05-27 Thread Keith Medcalf
> Flash for the sake of flash is not good, but sometimes you have to > show people that you and your product are keeping up with the times, not > already obsolete before you even download it and start using it. Can you explain why you think "flash", as you put it, means that something is

[sqlite] Windows 8.x security requirements / SafeSEHCheck - NXCheck - DBCheck

2015-04-02 Thread Keith Medcalf
add the following linker options with MinGW: -static-libgcc -Wl,-Bstatic,--nxcompat,--dynamicbase,--export-all-symbols You may or may not need -static-libgcc or the linker -Bstatic options unless you are also enabling things that require MingW DLL runtime support (such as using the -mthreads

[sqlite] Windows 8.x security requirements / SafeSEHCheck - NXCheck - DBCheck

2015-04-02 Thread Keith Medcalf
works but no one knows why. Sometimes theory and practice are combined: nothing works and no one knows why. >-Original Message- >From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- >bounces at mailinglists.sqlite.org] On Behalf Of Keith Medcalf >Sent:

[sqlite] Windows 8.x security requirements / SafeSEHCheck - NXCheck - DBCheck

2015-04-02 Thread Keith Medcalf
but no one knows why. Sometimes theory and practice are combined: nothing works and no one knows why. >-Original Message- >From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- >bounces at mailinglists.sqlite.org] On Behalf Of Keith Medcalf >Sent: Thurs

[sqlite] Prevent database file from being overwritten by other processes

2015-04-08 Thread Keith Medcalf
In the Amalgamation Source search for the line (around 37836): dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; If you change this to: dwShareMode = 0 then use this version of sqlite3.c in your application. This will open the file for "exclusive" access and not shared access. This

[sqlite] Select query becomes distinct on where matches unique with null value

2015-04-11 Thread Keith Medcalf
Interestingly if you run analyze, it works properly ... --- Theory is when you know everything but nothing works. Practice is when everything works but no one knows why. Sometimes theory and practice are combined: nothing works and no one knows why. >-Original Message- >From:

[sqlite] Thoughts on storing arrays of complex numbers

2015-04-24 Thread Keith Medcalf
Create table ComplexNumbers ( id integer primary key, real real not null default 0, imag real not null default 0 ); Then, where ever you need to use a complex number you store it in the complex number table and store the id of that number instead. For example: create table Boxes (

[sqlite] First-N query time scaling with table size

2015-04-24 Thread Keith Medcalf
Your query has to visit every row of table d and execute the correlated subquery multiple times. You need to devise a way to do this only once for each d.m and then join that table back into your query. >sqlite < demo.sql .eqp on .timer on CREATE TABLE d ( m INT NOT NULL, t INT NOT

[sqlite] CSV excel import

2015-08-01 Thread Keith Medcalf
Python with either xlrd or openpyxl. Why use a multiplicity when one programming environment will do? > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of Bernardo Sulzbach > Sent: Friday,

[sqlite] journal files not always removed

2015-08-15 Thread Keith Medcalf
This is something changed in SQLITE itself. These tests are on Windows 10 using the current MinGW compiler with the same configuration and windows headers. For the current head of trunk: 2015-08-15 12:17:05 [D:\Temp] >type test.sql pragma journal_mode=wal; pragma journal_mode; create table

[sqlite] journal files not always removed

2015-08-15 Thread Keith Medcalf
980,798,976 bytes free > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of Richard Hipp > Sent: Saturday, 15 August, 2015 12:41 > To: General Discussion of SQLite Database >

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Keith Medcalf
> Some temporary files have fixed names so they will be replaced the next > time SQLite tries to perform the same operation, and deleted when that one > finishes. Others will just hang about until the computer is rebooted and > will be deleted with other temporary files either on shutdown or on

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Keith Medcalf
> On 19 Aug 2015, at 1:36pm, Keith Medcalf wrote: > > Meaning that on a persistent temp storage the files will stay forever > (or until a manually deleted). Then again, on systems such as windows > where temp files are never deleted this is to be expected. > Hmm. On every

[sqlite] SQLite - Support for VSS writer

2015-12-01 Thread Keith Medcalf
It will support the same power-fail consistency as any other non-VSS aware application. That is, VSS will function as designed -- it will "look" like you "turned off the power" and then did an "offline" backup -- the resulting backup will be crash consistent. Like any product that uses

[sqlite] website documentation wording

2015-12-04 Thread Keith Medcalf
Well, a Gartner Report paid for by Microsoft, which said that if you pronounced it "ess queue ell" you were labelling yourself as a professional programmer who understood relational database technologies, had probably used them since the 1970's or before, and belonged in a dinosaur pen. On

[sqlite] website documentation wording

2015-12-04 Thread Keith Medcalf
Intel is a Corporation. Intel cannot, as a matter of fact and law, anywhere on the planet, decide anything. On the other hand, Intel's Management can make decisions. Therefore the correct statements are: Intel's Management has decided -- for the imperfect tense. Intel's Managemant have

[sqlite] Making data unique

2015-12-07 Thread Keith Medcalf
create table dataset ( id integer not null, timestamp integer not null, data integer not null, unique (id, timestamp) ); > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of

[sqlite] NOP INSERT still writes to the DB/journal

2015-12-08 Thread Keith Medcalf
If you execute an SQL statement in automagic mode, then BEGIN and COMMIT are magically wrapped around the statement -- you are absolutely correct and that is the purpose of the magic mode. Therefore doing: BEGIN; INSERT ... COMMIT; is EXACTLY IDENTICAL to INSERT with full automagic

[sqlite] Bug with DATETIME('localtime')

2015-12-10 Thread Keith Medcalf
In both cases the conversion is only correct when it is correct. Microsoft is a teeny weeny company that exists and does business only in one time zone and has existed for such a short period of time (and produces software which covers such short periods of time) that they have never ever

[sqlite] ABOUT ROWID

2015-12-11 Thread Keith Medcalf
> 1) disregard the results of the first query timing (this one has to read > the data into the cache) More correctly, you need to exclude the effects of any operation which primes the cache. This is not necessarily the "first" operation. Far better is to run the queries multiple times in

[sqlite] ABOUT ROWID

2015-12-11 Thread Keith Medcalf
Actually, you need to pull the power plug after you shut it down for more than 30 seconds, then plug it in and reboot. Only then are you sure the all the cache has been flushed. Alternatively, run the test many times (say 1000) and average the results. > -Original Message- > From:

[sqlite] Putting an index on a boolean

2015-12-12 Thread Keith Medcalf
The first question(s) I would ask are: Are all the fields case sensitive? (according to your definition they are) Are any of them, other than the primary key, unique? (according to your definition they are not) Other than the isPersonal column all of the columns permit a NULL entry. Is this

[sqlite] Putting an index on a boolean

2015-12-12 Thread Keith Medcalf
> > One other point: The use of grave accents to quote column names is a > > mysql-ism. SQLite also supports that for compatibility. But you > > still shouldn't do it. The proper SQL-standard way is double-quote. > ?That is funny: I did not use them at first (or double). But I am using 'DB >

[sqlite] last_insert_rowid() and changes() per statement instead of per connection?

2015-12-13 Thread Keith Medcalf
On Sun 2015-12-13 13:47, Simon Slavin wrote: > On 13 Dec 2015, at 5:34pm, Clemens Ladisch wrote: > > Olivier Mascia wrote: > >> should the design of competing threads revolve around each one having > >> a distinct connection handle? > > Yes. > Which, of course, decreases the point of you

[sqlite] last_insert_rowid() and changes() per statement instead of per connection?

2015-12-13 Thread Keith Medcalf
On Sunday, 13 December, 2015 17:04, Olivier Mascia wrote: > Thanks. I'm reading you with attention. > > Clemens: > > Please note that transactions work on the connection level. > That was clear. > > Simon: > > Which, of course, decreases the point of you having competing threads in > the

[sqlite] Bug with DATETIME('localtime')

2015-12-13 Thread Keith Medcalf
nces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of James K. Lowden > Sent: Sunday, 13 December, 2015 19:00 > To: sqlite-users at mailinglists.sqlite.org > Subject: Re: [sqlite] Bug with DATETIME('localtime') > > On Thu,

[sqlite] Problem with accumulating decimal values

2015-12-16 Thread Keith Medcalf
> Hello, so in short, rounding the column anywhere it is used, is > another solution. I confirmed this below. Thanks, E. Pasma. > > BEGIN; > UPDATE fmtemp SET bal = ROUND(bal,2) + 123.45; > (repeat a 1.000.001 times > END; > SELECT bal FROM fmtemp; > 123450123.45 Absolutely not! You should

[sqlite] Problem with accumulating decimal values

2015-12-17 Thread Keith Medcalf
> I was taught "Round [only] before printing.". These days it would be > something like "Round [only] before your API returns to the calling > program. Those are not the same. Round only before printing (whether to the screen or to a printer). In other words, rounding is a way to make things

[sqlite] about compile configure

2015-12-22 Thread Keith Medcalf
How long does it take to retrieve one record from the database? How long do you want it to take? > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of ??? > Sent: Tuesday, 22 December, 2015

[sqlite] Malloc getting segmentation fault in sqlite

2015-12-26 Thread Keith Medcalf
Have you instrumented your code? > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of Bart Smissaert > Sent: Saturday, 26 December, 2015 12:33 > To: SQLite mailing list > Subject: Re:

  1   2   3   4   5   6   7   8   9   10   >