Re: [sqlite] Inmemory database in sqlite

2014-10-17 Thread Tim Streater
On 17 Oct 2014 at 10:39, Prakash Premkumar wrote: > So the approach where we open the db with ":memory:" keyword does not > provide durability. Why is that any sort of surprise? What you're opening is a database called ":memory:". The string ":memory:" is the name of

Re: [sqlite] Installation_Procedure

2014-10-31 Thread Tim Streater
On 31 Oct 2014 at 03:38, Ayub Mytheen wrote: > I tried to configure SQLLite Setting in my laptop.i extract two zip file > from your link. i tried to set path environment variable > .We cant to configure to sqllite.if any body can help to guide how to > configure

Re: [sqlite] Locking errors on network

2014-11-10 Thread Tim Streater
On 10 Nov 2014 at 18:22, Mike McWhinney wrote: > So SQLite shouldn't be used at all on a network? Aren't there any other > provisions to handled the locking errors if/when > they occur? You tried setting a timeout as pointed to here?

Re: [sqlite] Locking errors on network

2014-11-10 Thread Tim Streater
On 10 Nov 2014 at 19:38, Mike McWhinney wrote: > I am using Sqlite.NET client in C#. How would I go about defining a sqlite > busy timeout handler? Is the API not documented somewhere (I don't know what Sqlite.NET client or C# are, so can't help)? Surely you must have

Re: [sqlite] Best Practice: Storing Dates

2015-01-15 Thread Tim Streater
On 14 Jan 2015 at 23:13, Simon Slavin wrote: > On 14 Jan 2015, at 10:40pm, Baruch Burstein wrote: > >> Of course, this is just at the theoretical level. As yo said, your app >> probably wouldn't need to worry about this. > > I think a previous poster

Re: [sqlite] Core dump with shared cache enabled

2015-01-23 Thread Tim Streater
On 22 Jan 2015 at 21:34, Daniel Roberts wrote: > Attached is a core file (sorry I don’t have symbols) as well as a copy of > the script I was running. Attachments are not allowed here. -- Cheers -- Tim ___ sqlite-users

Re: [sqlite] Invalid column prefix returned in SELECT with joined subquery

2015-01-26 Thread Tim Streater
On 26 Jan 2015 at 07:33, Hick Gunter wrote: > It is never a good idea to rely on automatically assigned column names. If you > want reproducible, predictable, release independant column names then please > assign them with the AS clause. So you're saying that if I do:

Re: [sqlite] Invalid column prefix returned in SELECT with joined subquery

2015-01-26 Thread Tim Streater
On 26 Jan 2015 at 12:23, Hick Gunter wrote: > NO. Only if all of the following apply > > - you are parsing and/or displaying raw returned column names > - your select contains more than one table (a table joined to itself counts > as 2) > - your tables have columns that share

Re: [sqlite] Bug in SQLite FLOAT values

2015-02-07 Thread Tim Streater
On 07 Feb 2015 at 05:57, Abdul Aziz wrote: > *I think this is a bug, this means float values in sqlite will always be > filled upto 11-12 decimal places, in any case, you will have to fill it, or > sqlite will fill it itself with junk values, **this may create lot of >

Re: [sqlite] unreached code in sqlite3.c?

2015-02-12 Thread Tim Streater
On 12 Feb 2015 at 19:14, R.Smith wrote: > On 2/12/2015 8:50 PM, Doug Currie wrote: >> It's easy enough to fix if you want 0 to be a valid value for TERM_VNULL: >> >> #if TERM_VNULL >> if( pTerm->wtFlags & TERM_VNULL ) continue; >> #endif > > Agreed, but how easy it is to

Re: [sqlite] Searching this mailing lsit

2016-05-24 Thread Tim Streater
On 24 May 2016 at 19:46, Kenneth Kasajian wrote: > It's funny how many messages there are here about the signature of my e-mail > (which I cannot control) You could set up a gmail address for these messages, f'rinstance. [snip two copies of your

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

2016-05-27 Thread Tim Streater
On 27 May 2016 at 08:56, Darren Duncan wrote: > On 2016-05-26 9:00 PM, Balaji Ramanathan wrote: >> The main advantage of forums, and I follow a bunch of them, is that I choose >> when I want to stop my regular day job and be distracted by them rather than >> emails

[sqlite] Segfault during FTS index creation from huge data

2015-04-29 Thread Tim Streater
On 28 Apr 2015 at 23:14, Artem wrote: >> How about trying the sqlite3.exe command line utility. put your >> sql for that operation in a text file, launch the program, open >> the database, then read in the sql file with the .read command. >> If the error occurs, then possibly sqlite3. if not

[sqlite] Segfault during FTS index creation from huge data

2015-04-29 Thread Tim Streater
On 29 Apr 2015 at 00:06, Simon Slavin wrote: > On 28 Apr 2015, at 11:49pm, Scott Robison wrote: > >> I never saw a segfault in my case, though I never tried anything on any >> posix style system. It was strictly Windows. > > Windows doesn't call it segfault. It will report an access violation

[sqlite] Database sybchronisation

2015-08-13 Thread Tim Streater
On 13 Aug 2015 at 09:05, Chris Parsonson wrote: > So can someone give me a working example of two database ATTACHed and a > simple select using columns from a table in each database Why not try the sequence you want using the sqlite3 CLI program, on a simple example that mimics the essence of

[sqlite] Database sybchronisation

2015-08-13 Thread Tim Streater
On 13 Aug 2015 at 11:34, Chris Parsonson wrote: > Has anybody ever used this ATTTACH command? Here's what I do to move a row from one database to another (same table/column defs). I have to go via a temporary db (I use the :memory: one) since the primary key needs a new value in the second

[sqlite] Database sybchronisation

2015-08-13 Thread Tim Streater
On 13 Aug 2015 at 16:20, Simon Slavin wrote: > On 13 Aug 2015, at 4:03pm, sqlite-mail wrote: > >> With that would be trivial to log the statements that change the database to >> replicate elsewhere. > > As Jean-Christophe wrote, it's not that simple. There are huge books written > on the

[sqlite] Boolean constraint regression between 3.7.7.1 and 3.8.6?

2015-08-17 Thread Tim Streater
On 17 Aug 2015 at 16:50, Olivier Barthelemy wrote: >> SQLite has no such type > I see nothing in Qt code that converts BOOLEAN in NUMERIC or anything else. > The statement is passed as is to sqlite. > On previously created sqlite files, when i open then in sqlite manager > addon of Firefox,

[sqlite] Compile warnings

2015-08-20 Thread Tim Streater
On 20 Aug 2015 at 17:46, Scott Doctor wrote: > My opinion is to keep it portable. The warning is there for a reason. > you are worried about performance yet are calling a function that does > nothing, which will take more memory cycles than a simple check for zero. > > Trying to memset a zero

[sqlite] Is this a bug ? How to rename a table and all dependencies ?

2015-08-22 Thread Tim Streater
On 22 Aug 2015 at 11:01, Kees Nuyt wrote: > It even would be fine to me if all ALTER TABLE features would be > removed. I disagree with this, although I'd be satisfied if there were a separate library and API for such things. With an evolving application I need to have ALTER TABLE. Even the

[sqlite] Why sqlite show qualified column names when selecting from views ?

2015-08-25 Thread Tim Streater
On 25 Aug 2015 at 19:37, Richard Hipp wrote: > On 25/8/15, Simon Slavin wrote: >> >> "If there is no AS clause then the name of the column is unspecified and may >> change from one release of SQLite to the next." > Heed this warning!!! > > And yet, there are countless tens of thousands of

[sqlite] order by not working in combination with random()

2015-08-27 Thread Tim Streater
On 27 Aug 2015 at 18:49, Simon Slavin wrote: > On 27 Aug 2015, at 6:41pm, Domingo Alvarez Duarte dev.dadbiz.es> > wrote: > >> select random(), random() from blah order by random() >> >> >> >> Error ambiguous column "random()" near "order by". > > Thing is, that's not ambiguous. I don't really

[sqlite] website documentation wording

2015-12-04 Thread Tim Streater
On 04 Dec 2015 at 17:13, Simon Slavin wrote: > The worst one is the collective corporation. Is it "Intel has decided" or > "Intel have decided" ? Whichever one I write for whichever side of the > Atlantic, I get told off for getting it wrong. I go with the US version in this instance; Intel

[sqlite] Problem with accumulating decimal values

2015-12-18 Thread Tim Streater
On 18 Dec 2015 at 00:06, Keith Medcalf wrote: >> 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

[sqlite] wish list for 2016

2015-12-24 Thread Tim Streater
On 24 Dec 2015 at 15:26, Bernardo Sulzbach wrote: > want a more versatile alter table for convenience. However, I don't > know if alter table is used at all in production anywhere (why would > it be? the column names and ordering should not be part of the data). If I distribute an app with a

[sqlite] List duplication

2015-02-28 Thread Tim Streater
On 27 Feb 2015 at 22:47, Simon Slavin wrote: > On 27 Feb 2015, at 10:04pm, R.Smith wrote: > >> Ah, I think this is the answer probably. Maybe people hitting the "reply to >> all" or such and it copies across lists. Simon is possibly not subscribed to >> both, hence not getting duplicates. > >

[sqlite] Query takes 8 seconds on one machine but I abort after 40+ minutes on other machines

2015-07-27 Thread Tim Streater
On 27 Jul 2015 at 13:44, rotaiv wrote: > Where is the resource bottleneck that causes a simple query to never > complete after 40 minutes > > I am using sqlite to synchronize files on my home PC and my work PC. I > created a file listing of each computer and imported into separate tables. And

[sqlite] sqlite3_config via the PHP interface to sqlite3

2015-03-11 Thread Tim Streater
On 11 Mar 2015 at 17:46, Richard Hipp wrote: > Am I correct in understanding that you have enabled the error and > warning log (https://www.sqlite.org/errlog.html) and it is not showing > anything unusual? The page at the link above references this call via the C interface:

[sqlite] What software is deployed more than SQLite?

2015-05-04 Thread Tim Streater
On 04 May 2015 at 17:31, jungle Boogie wrote: > On 4 May 2015 at 07:58, Warren Young wrote: >> On May 3, 2015, at 6:50 PM, jungle Boogie wrote: >>> >>> On 3 May 2015 at 11:18, Richard Hipp wrote: Any input you can provide is appreciated! >>> >>> Congratulations to you and your team on

[sqlite] Getting the row count when using the sqlite3 library

2013-10-23 Thread Tim Streater
On 22 Oct 2013 at 09:11, Simon Slavin wrote: > If you are writing code specifically intended for use with SQLite (like your > library was meant to be) then please use PHP's sqlite3 library rather than the > PDO. The advantage of using PDO is that if you transfer from one

Re: [sqlite] Getting the row count when using the sqlite3 library

2013-10-23 Thread Tim Streater
On 23 Oct 2013 at 15:02, Simon Slavin <slav...@bigfraud.org> wrote: > On 23 Oct 2013, at 1:15pm, Tim Streater <t...@clothears.org.uk> wrote: > >> HmmmOK. I'm therefore making a second attempt to use the sqlite3 PHP >> interface in my application instead of PDO.

Re: [sqlite] SQLite "Frontend"?

2013-10-27 Thread Tim Streater
On 27 Oct 2013 at 18:29, Ulrich Goebel wrote: > What I'm looking for is a bash-like frontend for SQLite. The sqlite3 > does in principle what I want, but to test queries it would be very nice > to have a history of the commands entered, so the can be recalled an > edidet

Re: [sqlite] Feature request: Better support for database file moving

2013-11-11 Thread Tim Streater
On 11 Nov 2013 at 15:36, Simon Slavin wrote: > On 11 Nov 2013, at 2:01pm, L. Wood wrote: > >> * A user could move the file during a transaction, i.e., between >> _prepare_v2(); and _finalize(); >> >> It seems that SQLite needs support for this situation.

Re: [sqlite] Feature request: Better support for database file moving

2013-11-12 Thread Tim Streater
On 12 Nov 2013 at 13:49, Simon Slavin wrote: > Doesn't matter because OS X is, at heart, Unix. Unix is a bit weird in that > it allows you to move and delete a file which is open. I wouldn't describe this as weird, it should be SOP for an OS, IMO. It's (one) of the

Re: [sqlite] Feature request: Better support for database file moving

2013-11-12 Thread Tim Streater
On 12 Nov 2013 at 16:14, Stephen Chrzanowski wrote: > **kind of off topic** > > @Tim> I'm no where near in thinking that it should be SOP. > > I'm somewhat appreciative of not being allowed to change the "file > containers" visual representation a file while something has

Re: [sqlite] Concrete example of corruption

2013-12-06 Thread Tim Streater
On 06 Dec 2013 at 03:31, Stephen Chrzanowski wrote: > On a personal note, I still cannot fathom why anyone would WANT to do file > management while working on an active document. Moving a document while > its being worked on contradicts everything I understand. I find

Re: [sqlite] Lightweight integrity_check?

2014-01-15 Thread Tim Streater
On 15 Jan 2014 at 19:20, Steven Fisher wrote: > After opening, I want to do some basic checking of my database. > > I’m finding integrity_check much too slow for some of my users (especially > with large amounts of data) but I don’t want to just blindly trust the > database

[sqlite] Pragmas

2014-01-16 Thread Tim Streater
>From time to time I see the use of a particular pragma recommended by the >experts here. However, the introduction to: http://www.sqlite.org/pragma.html specifically warns that any pragma is at risk of being removed from one release to the next. And indeed, some are marked as deprecated. It

[sqlite] Avoiding holding a lock for too long

2014-02-07 Thread Tim Streater
I have some PHP code, roughly as follows (ignoring error handling): $dbh = new SQLite3 ('/path/to/mydb'); $res = $dbh->query ('select a,b,c from mytable where d=23'); // for example while (true) { $reg = $res->fetchArray (SQLITE3_ASSOC); if ($reg===false) break; //

Re: [sqlite] Avoiding holding a lock for too long

2014-02-08 Thread Tim Streater
On 07 Feb 2014 at 23:04, Simon Slavin wrote: > You should not be manually setting any handle to null. Try calling > ->finalize() on the statement and eventually ->close() on the database, which > do more than just setting their value. If you are setting anything to null

Re: [sqlite] Avoiding holding a lock for too long

2014-02-08 Thread Tim Streater
On 08 Feb 2014 at 17:48, Simon Slavin <slav...@bigfraud.org> wrote: > On 8 Feb 2014, at 4:58pm, Tim Streater <t...@clothears.org.uk> wrote: >> I had a look at the PHP sqlite3 interface code, and it looks like ->query >> does prepare, step, and reset (if there

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-lineshell

2014-02-10 Thread Tim Streater
On 10 Feb 2014 at 19:25, Simon Slavin wrote: > I don't like the idea anyway. There should be no difference between > double-clicking on an app and starting it by typing its name. I would go for: 1) Warning at startup if an in-memory db is being used 2) Add .save

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-11 Thread Tim Streater
On 11 Feb 2014 at 21:49, Stephen Chrzanowski wrote: > I don't like the idea of letting the software decide what should be done > based on a configuration file. The .sqliterc file already exists, so you're too late. > Linux and Windows both can isolate processes from each

[sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
If I have a text column defined as it might be as MYCOL TEXT (that is with no default value), is there a way to distinguish in some row or other between a column into which no data has ever been entered, and a column that might have been set to a string, but later set to the empty string? (or

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
On 17 Feb 2014 at 14:10, Simon Slavin <slav...@bigfraud.org> wrote: > On 17 Feb 2014, at 11:37am, Tim Streater <t...@clothears.org.uk> wrote: > >> If I have a text column defined as it might be as MYCOL TEXT (that is with no >> default value), is there a way to di

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
On 17 Feb 2014 at 17:01, Stephan Beal wrote: > FWIW, i have seen a similar problem in a legacy app which uses latin1 > encoding in the DB. Latin1 doesn't always survive round-trip through PHP's > JSON APIs. My case was similar to yours, and we eventually determined that >

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Tim Streater
On 17 Feb 2014 at 18:38, Simon Slavin <slav...@bigfraud.org> wrote: > On 17 Feb 2014, at 4:57pm, Tim Streater <t...@clothears.org.uk> wrote: > >> Thanks. I should perhaps have made it clearer that I'm looking at an issue a >> user has. The application gathers som

[sqlite] Making string changes in a table

2014-03-09 Thread Tim Streater
I have a table with one column containing file paths, such as /path/to/file and /path/to/my/otherfile. Now I want to change all entries where the path starts as /path/to/ to /path/from/. Getting a candidate list is easy, and I can then make the changes in PHP and rewrite the rows, but I

Re: [sqlite] Making string changes in a table

2014-03-09 Thread Tim Streater
On 09 Mar 2014 at 22:17, Igor Tandetnik <i...@tandetnik.org> wrote: > On 3/9/2014 6:05 PM, Tim Streater wrote: >> I have a table with one column containing file paths, such as /path/to/file >> and /path/to/my/otherfile. Now I want to change all entries where the pa

Re: [sqlite] Making string changes in a table

2014-03-10 Thread Tim Streater
On 09 Mar 2014 at 22:48, Igor Tandetnik <i...@tandetnik.org> wrote: > On 3/9/2014 6:37 PM, Tim Streater wrote: >> Dammit, I looked up and down for 'strlen' and passed over 'length'! I had >> been thinking about: >> >>update mytable set path='/path/fro

Re: [sqlite] sqlite3.exe file not produced by sqlite-autoconf-3080400.tar.gz on Cygwin

2014-03-11 Thread Tim Streater
On 11 Mar 2014 at 16:11, Keith Christian wrote: > The resulting file is quite large, almost 14 times the size of the > sqlite3 version 3.8.3 packages with Cygwin: > > ls -l /usr/bin/sqlite3.exe > -rwxr-xr-x 1 kchris Domain Users 60957 Feb 4 04:45

[sqlite] Opening and closing an SQLITE3 db in PHP

2014-03-18 Thread Tim Streater
Part of my app will, at user request, read some data from an SQLite db and also some files from disk, and send it all out on the network. This may in some cases take several minutes, at the end of which the db gets updated here and there. While this is happening, the user may wish to do another

Re: [sqlite] Opening and closing an SQLITE3 db in PHP

2014-03-19 Thread Tim Streater
On 19 Mar 2014 at 00:53, Simon Slavin wrote: >> 1) I start with $dbh = new sqlite3 ($dbname); Am I right in thinking that >> this does not explicitly open the db (and hence acquire a lock), but that the >> db is opened and the default lock (SQLITE_OPEN_READWRITE | >>

Re: [sqlite] Opening and closing an SQLITE3 db in PHP

2014-03-19 Thread Tim Streater
On 19 Mar 2014 at 12:45, Simon Slavin <slav...@bigfraud.org> wrote: > On 19 Mar 2014, at 11:21am, Tim Streater <t...@clothears.org.uk> wrote: > >> So I could do: $dbh = new sqlite3 ($dbname, SQLITE_OPEN_READONLY); ?? > > Yes. I think that's the way you're meant

[sqlite] How good is pragma integrity_check

2014-03-20 Thread Tim Streater
I had a case where attempts to access a table in a user's db gave "no such table", where 60 mins previously (according to the log) querying that table gave no problems. About a day and a half later the user's machine had what he described as a "bad crash", so I'm suspecting he has a failing

Re: [sqlite] How good is pragma integrity_check

2014-03-21 Thread Tim Streater
On 21 Mar 2014 at 01:06, Simon Slavin <slav...@bigfraud.org> wrote: > On 20 Mar 2014, at 11:33pm, Richard Hipp <d...@sqlite.org> wrote: > >> On Thu, Mar 20, 2014 at 7:18 PM, Tim Streater <t...@clothears.org.uk> wrote: >> >>> I had a case where a

Re: [sqlite] How good is pragma integrity_check

2014-03-24 Thread Tim Streater
On 24 Mar 2014 at 08:36, Dominique Devienne wrote: > On Mon, Mar 24, 2014 at 6:23 AM, Roger Binns wrote: >> So you don't have to use it. Those of us who would rather proactively >> know about data corruption (to the best of SQLite's ability to

Re: [sqlite] Is there a way to load a blob from the shell?

2014-04-08 Thread Tim Streater
On 08 Apr 2014 at 00:13, Richard Hipp wrote: > On Mon, Apr 7, 2014 at 6:56 PM, Keith Christian > wrote: > >> >> However, on production *nix machines, the path to the SQLite 'sar' >> will probably have to be absolute, or else the native 'sar' (System >>

Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Tim Streater
On 13 Apr 2014 at 11:55, Richard Hipp wrote: > The UPDATE OR REPLACE also seems to be an essential component. The > following simplified test case causes an assertion fault: > > CREATE TABLE t1(a,b); > CREATE UNIQUE INDEX t1ab ON t1(a,b); > CREATE INDEX t1b ON t1(b) WHERE b=1;

Re: [sqlite] cannot set connection while a datareader is active

2014-04-14 Thread Tim Streater
On 14 Apr 2014 at 15:14, Stefano Ravagni wrote: > I would ask if you seen the screenshot i attached somes days ago because > it show what happen Attachments are not allowed here. tim. ___ sqlite-users mailing list

Re: [sqlite] SQLite Database Browser officially moved to GitHub

2014-05-20 Thread Tim Streater
On 20 May 2014 at 14:11, jus...@postgresql.org wrote: > Hi all, > > Just a small heads up. The old SQLite Database > Browser project on SourceForge is officially > on GitHub as of today, and we've made a new > release (v3.1) as well. New website too (using > GitHub pages): > >

Re: [sqlite] SQLite Database Browser officially moved to GitHub

2014-05-20 Thread Tim Streater
On 20 May 2014 at 14:11, jus...@postgresql.org wrote: > http://sqlitebrowser.org > https://github.com/sqlitebrowser/sqlitebrowser Sorry, should have said I'm on OS X Mavericks 10.9.3. -- Cheers -- Tim ___ sqlite-users mailing list

Re: [sqlite] SQLite Database Browser officially moved to GitHub

2014-05-21 Thread Tim Streater
On 21 May 2014 at 00:17, RSmith <rsm...@rsweb.co.za> wrote: > On 2014/05/20 23:37, Tim Streater wrote: >> Sorry, should have said I'm on OS X Mavericks 10.9.3. > > We know... no other OS would report CPU usage as 400%... :) :-) Well, to be fair, I don't know what OS X

[sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Tim Streater
I have a text column containing floating point strings like 23.6, 8.4, 0.3, etc. These always have just the one digit after the decimal point. This column was sometimes being used in an ORDER BY and then I realised that it wasn't going to sort properly. The use of a TEXT field was deliberate in

Re: [sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Tim Streater
On 22 Jun 2014 at 10:08, Clemens Ladisch <clem...@ladisch.de> wrote: > Tim Streater wrote: >> I have a text column containing floating point strings like 23.6, 8.4, >> 0.3, etc. These always have just the one digit after the decimal point. >> >> ... ORDER BY RO

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Tim Streater
On 04 Jul 2014 at 11:43, Simon Slavin wrote: > On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: > >> I've encountered some odd behaviour when using the sqlite3_column_name >> function. > > Sorry, but column names are guaranteed only if you use an

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Tim Streater
On 04 Jul 2014 at 15:35, Simon Slavin <slav...@bigfraud.org> wrote: > On 4 Jul 2014, at 12:28pm, Tim Streater <t...@clothears.org.uk> wrote: > >> On 04 Jul 2014 at 11:43, Simon Slavin <slav...@bigfraud.org> wrote: >> >>> On 3 Jul 2014, at 10:22pm,

[sqlite] I want to use CREATE TABLE ... AS SELECT ... - but what if the SELECT returns no rows?

2014-07-10 Thread Tim Streater
I have just noticed this syntax which will simplify some table creation for me. However in some instances where I want to use it, I have a handy SELECT available, but I don't want to actually insert a row at that time. Testing with the shell, the following appears to work: attach database

Re: [sqlite] I want to use CREATE TABLE ... AS SELECT ... - but what if the SELECT returns no rows?

2014-07-10 Thread Tim Streater
On 10 Jul 2014 at 11:20, Dan Kennedy <danielk1...@gmail.com> wrote: > On 07/10/2014 04:45 PM, Tim Streater wrote: >> I have just noticed this syntax which will simplify some table creation for >> me. However in some instances where I want to use it, I have a handy SELECT >

Re: [sqlite] I want to use CREATE TABLE ... AS SELECT ... - but what if the SELECT returns no rows?

2014-07-10 Thread Tim Streater
On 10 Jul 2014 at 12:45, Simon Slavin wrote: > On 10 Jul 2014, at 11:47am, Clemens Ladisch wrote: > >> This is indeed misleading. The result set actually has columns and >> column names even when there are now rows in it, so this is guaranteed >> to

Re: [sqlite] I want to use CREATE TABLE ... AS SELECT ... - but what if the SELECT returns no rows?

2014-07-10 Thread Tim Streater
On 10 Jul 2014 at 14:17, Mark Lawrence <no...@null.net> wrote: > On Thu Jul 10, 2014 at 01:52:00PM +0100, Tim Streater wrote: >> >> What I'm actually doing is moving/copying a row from one database to >> another, where the two databases have identical schemas. >>

Re: [sqlite] Importing a cvs file

2014-07-19 Thread Tim Streater
On 19 Jul 2014 at 19:06, Jonathan Leslie wrote: > h'mmm never new about ascii 28-31 either.   I don't know why these things are > kept a secret. They aren't, you've obviously never bothered to look at the ASCII table, which, oddly enough, can be found here:

Re: [sqlite] Hexadecimal integer literals

2014-07-23 Thread Tim Streater
On 23 Jul 2014 at 12:07, Richard Hipp wrote: > We are looking into adding hexadecimal integer literals to SQLite. In > other words, we are looking to enhance SQLite to understand 0x1234 as > another way of writing 4660. Hex literals are useful in conjunction with > the

Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-23 Thread Tim Streater
On 23 Jul 2014 at 19:43, Simon Slavin wrote: >> -what line number or when was this issue first detected > > SQLite does not know how your application is organised. One particular API > call returns the error, so you know where the error was found: it was by that > call.

Re: [sqlite] Handling Timezones

2014-08-02 Thread Tim Streater
On 02 Aug 2014 at 00:27, Stephen Chrzanowski wrote: > I understand that with routing and such, you can end up outside where you > really are (With my IP, I'm shown just outside of Toronto when I'm actually > two hours out), but the chances of showing up in Taiwan when

Re: [sqlite] R-tree query regression, in SQLite library on latest Mac OS X beta

2014-09-11 Thread Tim Streater
On 11 Sep 2014 at 00:50, Simon Slavin wrote: > Don't worry too much about this. In the last count of an OS X version I > counted seven different copies of SQLite being used in various places, > integrated into programs, or as libraries, or as the shell tool. And these >

Re: [sqlite] presentation about ordering and atomicity of filesystems

2014-09-13 Thread Tim Streater
On 13 Sep 2014 at 16:39, Richard Hipp wrote: > I say that a filesystem is an eventually-consistent key/value database. > The keys are the filenames and the values are all big BLOBs, specifically > the file content. Filesystems also have a hierarchical keyspace, which is > an

Re: [sqlite] An order by problem, maybe a bug?

2014-09-21 Thread Tim Streater
On 21 Sep 2014 at 16:18, James K. Lowden wrote: > Really? HM Revenue and Customs doesn't require you to distinguish > between your given and family names once a year? Search me. As long as I get my tax adviser to file my tax return once a year, and send them dosh

[sqlite] (no subject)

2011-08-31 Thread Tim Streater
Today when trying to copy from one database to another, I had the following error (simplified example below): Second-Mini% sqlite3 test1 sqlite> create table test (absid integer primary key, otherfield integer); sqlite> insert into test (absid,otherfield) values (null, 10); sqlite>

Re: [sqlite] (no subject)

2011-09-01 Thread Tim Streater
On 31 Aug 2011 at 23:24, Igor Tandetnik <itandet...@mvps.org> wrote: > On 8/31/2011 5:56 PM, Tim Streater wrote: >> In the above, each database is newly created as shown. What I had >> forgotten to do was to create the "test" table in the second database >>

Re: [sqlite] Track DML (from certain clients only)

2011-09-02 Thread Tim Streater
On 02 Sep 2011 at 16:58, Stephan Beal wrote: > On Fri, Sep 2, 2011 at 5:32 PM, Frans Knibbe wrote: > >> If SQLite could log this statement including the comment, it would still be >> possible to distinguish sources. Or reject the logging of

[sqlite] Database schema has changed?

2011-09-13 Thread Tim Streater
About once every few months I get this error (under OS X 10.7.1): SQLite error: general code: HY000 error: 17, database schema has changed and since all the rest of the time the code works fine I'm having some trouble pinning down whether it's my bug (more likely) and if so where, or an

Re: [sqlite] Database schema has changed?

2011-09-13 Thread Tim Streater
On 13 Sep 2011 at 13:04, Simon Slavin <slav...@bigfraud.org> wrote: > On 13 Sep 2011, at 12:13pm, Tim Streater wrote: > >> SQLite error: general code: HY000 error: 17, database schema has changed >> >> and since all the rest of the time the code works fine I'm

Re: [sqlite] Database schema has changed?

2011-09-13 Thread Tim Streater
On 13 Sep 2011 at 17:03, Simon Slavin <slav...@bigfraud.org> wrote: > On 13 Sep 2011, at 4:38pm, Tim Streater wrote: > >> In general the row could get moved around any number of databases and then >> back to the original one. > > That's one reason I think mak

Re: [sqlite] Does coalesce terminate early?

2011-09-15 Thread Tim Streater
On 15 Sep 2011 at 18:21, Jay A. Kreibich wrote: > On Thu, Sep 15, 2011 at 11:13:57AM -0500, Puneet Kishor scratched on the wall: > >> While your suggested documentation won't harm, and will likely help, >> actually the above does suggest to me a short-circuit-ish kind of >>

Re: [sqlite] c-api document suggestion

2011-09-23 Thread Tim Streater
On 23 Sep 2011 at 11:18, Mirek Suk wrote: > Dne 23.9.2011 4:41, Igor Tandetnik napsal(a): >> Note that I didn't say it was wise to store NUL characters as part of the >> string - I only said that you could do it if you wanted to. sqlite3_bind_text >> takes the length

[sqlite] Still chasing "database schema has changed"

2011-09-26 Thread Tim Streater
Thinking some more about the occasional instances of "database schema has changed" that I experience, I took a look through the amalgamation to see where this error might be being detected. Reading the code and the comments I'm reminded of something I keep forgetting: that SQLite has no server.

Re: [sqlite] Still chasing "database schema has changed"

2011-09-26 Thread Tim Streater
On 26 Sep 2011 at 22:40, Simon Slavin <slav...@bigfraud.org> wrote: > On 26 Sep 2011, at 10:30pm, Tim Streater wrote: >> My question now is, if two or more PHP scripts are competing for access to >> the same database, is "database schema has changed" a possible ou

Re: [sqlite] Still chasing "database schema has changed"

2011-09-27 Thread Tim Streater
On 27 Sep 2011 at 00:19, Simon Slavin <slav...@bigfraud.org> wrote: > On 26 Sep 2011, at 11:32pm, Tim Streater wrote: > >> For the most part it's going to be SELECT, INSERT, UPDATE, BEGIN, COMMIT. >> Less often, there's VACUUM. Let me have a look at my logs - OK, when

Re: [sqlite] Still chasing "database schema has changed"

2011-09-27 Thread Tim Streater
On 27 Sep 2011 at 00:19, Simon Slavin <slav...@bigfraud.org> wrote: > On 26 Sep 2011, at 11:32pm, Tim Streater wrote: >> But, very often the database on which the error occurs is :memory: - and I >> guess each thread will have its own one of those. > > Are you doin

Re: [sqlite] Still chasing "database schema has changed"

2011-09-27 Thread Tim Streater
On 27 Sep 2011 at 12:23, Simon Slavin <slav...@bigfraud.org> wrote: > On 27 Sep 2011, at 10:49am, Tim Streater wrote: > >> On 27 Sep 2011 at 00:19, Simon Slavin <slav...@bigfraud.org> wrote: >> >>> I believe that VACUUM is one of the statements which cou

Re: [sqlite] Still chasing "database schema has changed"

2011-09-27 Thread Tim Streater
On 27 Sep 2011 at 18:15, Richard Hipp <d...@sqlite.org> wrote: > On Tue, Sep 27, 2011 at 1:13 PM, Tim Streater <t...@clothears.org.uk> wrote: > >> The databases that get vacuumed tend to have a fair amount of traffic in >> and out. So it's good to compress them

Re: [sqlite] Still chasing "database schema has changed"

2011-09-28 Thread Tim Streater
On 28 Sep 2011 at 00:25, Richard Hipp <d...@sqlite.org> wrote: > On Tue, Sep 27, 2011 at 7:16 PM, Tim Streater <t...@clothears.org.uk> wrote: > >> On 27 Sep 2011 at 18:15, Richard Hipp <d...@sqlite.org> wrote: >> >>> On Tue, Sep 27, 2011 at 1:13 PM,

[sqlite] Statement failing

2011-10-08 Thread Tim Streater
I have this string: attach database ':memory:' as mem; create table mem.messages ( absid integer, ..., replyto text ); (where the ellipsis represents a number of other column declarations). In PHP, I do this: $dbh->query ($str); where $str contains the string from above. It completes

Re: [sqlite] Statement failing

2011-10-08 Thread Tim Streater
On 08 Oct 2011 at 23:32, Simon Slavin <slav...@bigfraud.org> wrote: > On 8 Oct 2011, at 10:37pm, Tim Streater wrote: > >> I have this string: >> >> attach database ':memory:' as mem; create table mem.messages ( absid >> integer, ..., replyto text );

Re: [sqlite] Statement failing

2011-10-08 Thread Tim Streater
On 08 Oct 2011 at 23:32, Simon Slavin <slav...@bigfraud.org> wrote: > On 8 Oct 2011, at 10:37pm, Tim Streater wrote: > >> I have this string: >> >> attach database ':memory:' as mem; create table mem.messages ( absid >> integer, ..., replyto text );

Re: [sqlite] new user

2011-10-09 Thread Tim Streater
On 09 Oct 2011 at 10:40, saeed ahmed wrote: > i am a new to sqlite. i want to know how can i make sqlite looking like > microsoft access? similar working environment, like making tables, queries > etc. actually i find it difficult to work in writing commands mode. any

Re: [sqlite] Statement failing

2011-10-09 Thread Tim Streater
On 09 Oct 2011 at 02:02, Simon Slavin <slav...@bigfraud.org> wrote: > On 9 Oct 2011, at 1:39am, Tim Streater wrote: > >> On 08 Oct 2011 at 23:32, Simon Slavin <slav...@bigfraud.org> wrote: >> >>> I'm not clear whether you're using the PDO or the sqlite3 ext

Re: [sqlite] Statement failing

2011-10-09 Thread Tim Streater
On 09 Oct 2011 at 17:00, Simon Slavin <slav...@bigfraud.org> wrote: > On 9 Oct 2011, at 4:52pm, Tim Streater wrote: > >> At present, I'm using PDO and setting it to throw exceptions. So I have a >> try/catch around all my $dbh->query and in there, log what ha

[sqlite] Multiple statements

2011-10-10 Thread Tim Streater
Looking at the description text for sqlite3_exec (SQLite C interface), I see this text: "The sqlite3_exec() interface runs zero or more UTF-8 encoded, semicolon-separate SQL statements passed into its 2nd argument, in the context of the database connection passed in as its 1st argument." Now,

  1   2   3   >