[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] Problem with method numRows() in Sqlite3

2013-09-23 Thread Tim Streater
On 23 Sep 2013 at 04:50, pisey phon wrote: > I got an error "Call to undefined method SQLite3Result::numRows()". and here > is my code: > $db = new Sqlite3("sample.db"); > $result = $db->query("select * from table"); > $rows = $result->numRows(); Sorry, ignore my last

Re: [sqlite] Problem with method numRows() in Sqlite3

2013-09-23 Thread Tim Streater
On 23 Sep 2013 at 04:50, pisey phon wrote: > I got an error "Call to undefined method SQLite3Result::numRows()". and here > is my code: > $db = new Sqlite3("sample.db"); > $result = $db->query("select * from table"); > $rows = $result->numRows(); Don't do that. Do:

Re: [sqlite] A graphical tool to handle sqlite schema change(more than ALTER TABLE)

2013-09-18 Thread Tim Streater
On 18 Sep 2013 at 01:49, niubao wrote: > Is there a tool that allows you to graphically change sqlite schema as simple > as editing a spreadsheet? For example if I wanted to change a column name > from "my_driving_hours" to "driving_time", instead of writing a line of >

Re: [sqlite] Question about date & time

2013-09-15 Thread Tim Streater
On 15 Sep 2013 at 18:13, William Drago wrote: > All, > > Should I put date and time in separate columns if I want to > select by time? > > For example: > > SELECT * FROM testresults WHERE (status != "Pass") AND > (23:00 <= testtime) AND (testtime <= 01:00). > > I have

Re: [sqlite] Hints for the query planner

2013-09-10 Thread Tim Streater
On 10 Sep 2013 at 20:26, Richard Hipp wrote: > SURVEY QUESTION: > > The question for today is what to call this magic hint function: > > (1) unlikely(EXPR) > (2) selective(EXPR) > (3) seldom(EXPR) > (4) seldom_true(EXPR) > (5) usually_not_true(EXPR) > > Please feel free to

Re: [sqlite] SQLite and integer division 1/2=0

2013-05-12 Thread Tim Streater
On 12 May 2013 at 19:15, Paul van Helden wrote: > I can live with SELECT 1/2 vs SELECT 1.0/2. The problem is that there is no > way to specify a float when you insert into a NUMERIC. 1.0 turns into an > integer. Then you do a division on all rows with an SQL select and you

Re: [sqlite] Problem getting utf-8 text out of a text column

2013-03-22 Thread Tim Streater
On 21 Mar 2013 at 23:30, Richard Hipp <d...@sqlite.org> wrote: > On Thu, Mar 21, 2013 at 6:52 PM, Tim Streater <t...@clothears.org.uk> wrote: > >> I have a column defined as TEXT and I insert utf-8 text into it. In >> particular, there are byte sequences that might

Re: [sqlite] Problem getting utf-8 text out of a text column

2013-03-21 Thread Tim Streater
Simon, Thanks for the suggestions. I should have mentioned that I'm running under OS X so I have the sqlite3 application and can easily do the tests you suggest. But that'll have to be tomorrow - time for shuteye now :-) Cheers -- tim ___

[sqlite] Problem getting utf-8 text out of a text column

2013-03-21 Thread Tim Streater
I have a column defined as TEXT and I insert utf-8 text into it. In particular, there are byte sequences that might look as follows: ... 74 6F 20 C2 A3 32 35 30 ... (in hex) which represents: ... to £250 ... I used Navicat for SQLite Lite to peer at the data as hex and text in the column, and it

Re: [sqlite] Full covering index without table

2013-03-05 Thread Tim Streater
On 05 Mar 2013 at 15:05, Richard Hipp wrote: > Both implementations allow for reading just the prefix of the content blob > in order to access earlier fields of a table, leaving the tail of the blob > unread on disk. So in all cases, it pays to put your frequently accessed >

Re: [sqlite] SQLite on a Mac: PHP doesn't know about :-(

2013-02-22 Thread Tim Streater
On 22 Feb 2013 at 20:51, Didier Morandi wrote: > very reason why noone (but Geeks) will ever move from VBScript to > PowerShell. Richard, I will not start learning OOP at 62 to be able to > use SQLite. Sorry for that. I'll stick to MySQL and good old > procedural PHP.

Re: [sqlite] SQLite Native in PHP in the future?

2013-01-13 Thread Tim Streater
On 13 Jan 2013 at 10:17, Tracy Rohan wrote: > Hi, I read that SQLite may not be native in PHP in the future? When I say > native, I mean that platform/devices will need to install SQLite as an > extension before it will function (as it was previously). Is this true? Why

Re: [sqlite] sqlite3.dll missing, HELP please :)

2013-01-06 Thread Tim Streater
On 06 Jan 2013 at 22:41, Simon Slavin <slav...@bigfraud.org> wrote: > On 6 Jan 2013, at 7:39pm, Tim Streater <t...@clothears.org.uk> wrote: > >> On 06 Jan 2013 at 17:11, Simon Slavin <slav...@bigfraud.org> wrote: >> >>> On 6 Jan 2013, at 5:09pm, Ric

Re: [sqlite] sqlite3.dll missing, HELP please :)

2013-01-06 Thread Tim Streater
On 06 Jan 2013 at 17:11, Simon Slavin wrote: > On 6 Jan 2013, at 5:09pm, Richard Hipp wrote: > >> I am a Windows VISTA Home Basic 2007 user who needs some help, please. >> Every time I turn on my PC, Windows tells me the SQLITE3.DLL file is >> missing. >

Re: [sqlite] SQLite logo usage

2012-12-10 Thread Tim Streater
On 10 Dec 2012 at 14:40, Simon Slavin wrote: > On 10 Dec 2012, at 2:38pm, Richard Hipp wrote: > >> The "SQLite" name and the new SQLite Logo are registered trademarks. > > Let's ask it a different way. If I write something and want to list SQLite as >

Re: [sqlite] String not valid DateTime

2012-12-10 Thread Tim Streater
On 10 Dec 2012 at 14:05, William Drago wrote: > I am using SQLite with C# and am having trouble with SQLite > DATETIME types. The following error occurs when trying to > read rows from a table that contains dates (e.g. "12/09/2012 > 22:51:24"). (I am using a

Re: [sqlite] SQLite converts all unicode characters into ANSI

2012-11-19 Thread Tim Streater
On 19 Nov 2012 at 01:57, ZikO wrote: > The script looks like this: > CREATE TABLE IF NOT EXISTS imiona ( > id INTEGER PRIMARY KEY, > data TEXT, > imie1 TEXT, > imie2 TEXT, > imie3 TEXT); > > INSERT INTO imiona (data,imie1,imie2,imie3) VALUES >

Re: [sqlite] Right way to store binary data into a blob

2012-10-03 Thread Tim Streater
On 03 Oct 2012 at 10:50, Clemens Ladisch <clem...@ladisch.de> wrote: > Tim Streater wrote: >> What's the right way to get the data into the column? > > 1) Use SQLite blob literals, which are hex strings with an "x" prefix: > > ... set imagedata = x'ffd8

[sqlite] Right way to store binary data into a blob

2012-10-03 Thread Tim Streater
I've got a temporary database with a blob column. I'm using the PHP PDO interface, and I'd like to store some binary data into the blob; it's actually an image. Later I'm going to read it back and write it to disk. What's the right way to get the data into the column? At the moment I'm using

Re: [sqlite] sqlite Unofficial poll

2012-09-23 Thread Tim Streater
On 23 Sep 2012 at 11:37, Baruch Burstein wrote: > I am curious about the usefulness of sqlite's "unique" type handling, and > so would like to know if anyone has ever actually found any practical use > for it/used it in some project? I am referring to the typeless handling,

Re: [sqlite] sqlite select max(field1), field2 from table1

2012-09-12 Thread Tim Streater
On 12 Sep 2012 at 11:37, Richard Hipp wrote: > On Wed, Sep 12, 2012 at 6:15 AM, Bart Smissaert > wrote: > >> Had a look at the new option as in the SQL above. >> Noticed it will only return one record, even if there are more records >> where >> field1

Re: [sqlite] How to build a new sqlite3.dylib?

2012-08-06 Thread Tim Streater
On 06 Aug 2012 at 22:49, Simon Slavin wrote: > On 6 Aug 2012, at 10:29pm, Tobias Giesen wrote: > >> would you be willing to share your dylib with me? I don't know how to >> do this with Xcode. > > Do you absolutely need to use a dynamic library ?

Re: [sqlite] How to build a new sqlite3.dylib?

2012-08-06 Thread Tim Streater
On 04 Aug 2012 at 11:54, Tobias Giesen wrote: > I was able to compile the sqlite3 shell, but how to create the latest > dylib, or where can I download it? I use xcode for this purpose, using the amalgamation. -- Cheers -- Tim

Re: [sqlite] How to compile and load the example fts4 rank function?

2012-07-21 Thread Tim Streater
On 21 Jul 2012 at 17:51, Pavel Ivanov wrote: > On Sat, Jul 21, 2012 at 3:36 AM, AJ ONeal wrote: >> I naively tried >> >> wget >> https://raw.github.com/gist/3154964/d570955d45580c095c99de6eb0c378395d4b076d/ >> sqlite3-fts4-rank.c >> gcc -c

Re: [sqlite] EXT :Re: Can't create empty database

2012-06-25 Thread Tim Streater
On 25 Jun 2012 at 14:30, Niall O'Reilly wrote: > On 25 Jun 2012, at 13:24, Black, Michael (IS) wrote: > >> Does the shell compile differently for Mac? > > Sorry. I've no idea whether it does. > SQLite comes bundled with OSX and I haven't had a need to build it

Re: [sqlite] Using a select with 'where'

2012-04-27 Thread Tim Streater
On 27 Apr 2012 at 22:16, Simon Slavin <slav...@bigfraud.org> wrote: > On 27 Apr 2012, at 9:00pm, Tim Streater <t...@clothears.org.uk> wrote: >> delete from addressbook where absid=(select personnick from grouplinks where >> groupnick='27') >> >> The 'sele

Re: [sqlite] Using a select with 'where'

2012-04-27 Thread Tim Streater
On 27 Apr 2012 at 21:03, Stephan Beal <sgb...@googlemail.com> wrote: > On Fri, Apr 27, 2012 at 10:00 PM, Tim Streater <t...@clothears.org.uk> wrote: > >> delete from addressbook where absid=(select personnick from grouplinks >> where groupnick='27') > >

[sqlite] Using a select with 'where'

2012-04-27 Thread Tim Streater
I'd like to delete multiple rows using the following syntax, but experiment appears to show that at most one row is deleted. I tried the following: delete from addressbook where absid=(select personnick from grouplinks where groupnick='27') The 'select personnick ...' can return zero, one,

Re: [sqlite] sqlite3 column widths

2012-04-25 Thread Tim Streater
On 25 Apr 2012 at 17:36, Pete wrote: > So I guess that's a "No" then? > > I'm fully aware of how sqlite3 treats datatypes and column width > specifications, but surely if someone defines a column with a specific max > width, it's reasonable to assume that's the max width

Re: [sqlite] make sqlite3_analyzer No rule to make target `sqlite3_analyzer'. Stop.

2012-03-30 Thread Tim Streater
On 30 Mar 2012 at 04:11, vaiStardom wrote: > I can't seem to use the sqlite3_analyzer on my MacBook Pro 2010 i7. > > Following the instructions in the book 'The Definitive Guide To Sqlite', to > analyze the test.db all I have to do is issue the command 'sqlite3_analyzer >

Re: [sqlite] Manual

2012-03-03 Thread Tim Streater
On 03 Mar 2012 at 15:57, Mark Schonewille wrote: > Could you just tell me where I find a good on-line manual? Thanks. I'm not aware of any similar to the mysql one - but perhaps I haven't looked particularly. But you didn't answer my question about the

Re: [sqlite] Manual

2012-03-03 Thread Tim Streater
On 03 Mar 2012 at 15:15, Mark Schonewille wrote: > MySQL has a really great manual with extensive explanations and dozens of > examples for each command. SQLite is none of all this. It just has a limited > number of pages listing a small number of commands and

Re: [sqlite] sqlite3_step getting core dumbed.

2012-02-10 Thread Tim Streater
On 10 Feb 2012 at 07:55, bhaskarReddy wrote: > PRAGMA table_info(yourtablename); will display colNumber, colName, colType, > > ex: 0|slotId|INTEGER|0||0 > 1|ponChannelId|INTEGER|0||0 > 2|onuType|INTEGER|0||0 > 3|onuSerialNumber|TEXT|0||0 > 4|onuId|INTEGER|0||0 >

Re: [sqlite] Query on Sqlite3 in an Android app

2012-02-09 Thread Tim Streater
On 09 Feb 2012 at 15:40, Lavanya Ramanan wrote: > And I would also like to know what GUI do people generally use for sqlite > database. Navicat for SQLite Lite, although I rarely need to use it. Very occasionally I want to see the hex of some database column. --

Re: [sqlite] ALTER TABLE

2012-02-06 Thread Tim Streater
On 06 Feb 2012 at 19:31, Ryan Johnson wrote: > On 06/02/2012 1:59 PM, Bill McCormick wrote: >> The order is not important. What is important is that I come up with >> some way to manage version updates. I've tried doing something similar >> in the past using an

Re: [sqlite] Is there any API for counting number of rows in a particular table.

2012-01-31 Thread Tim Streater
On 30 Jan 2012 at 21:58, Bart Smissaert wrote: > OK, so how you open those then with SQLiteRoot? I use PHP, thus: $dbh = new PDO ("sqlite:" . $db); where $db is a string like "/path/to/database". I don't know what SQLiteRoot is although possibly I should do.

Re: [sqlite] Is there any API for counting number of rows in a particular table.

2012-01-30 Thread Tim Streater
On 30 Jan 2012 at 16:37, Bart Smissaert wrote: > How do you make it open database files that have an extension other than .slt? Eh? None of my SQLite databases has any extension at all. -- Cheers -- Tim ___ sqlite-users

Re: [sqlite] Incompatible versions of SQLite on same system

2012-01-24 Thread Tim Streater
On 24 Jan 2012 at 20:02, Joe Winograd wrote: > Thanks for the idea, but it will not install. The way this group operates > with excessive trimming/snipping ... No it doesn't. It doesn't do *enough* trimming and snipping, and as a result our inboxes grow exponentially. If I

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Tim Streater
On 18 Jan 2012 at 15:24, Petr Lázňovský wrote: >> Sorry, 'windows batch' doesn't mean anything to me. > > http://en.wikipedia.org/wiki/Batch_file > > but wikipedia is reasonlessly turned off today > > > > ___ > sqlite-users mailing

Re: [sqlite] insert image into db - windows batch

2012-01-18 Thread Tim Streater
On 18 Jan 2012 at 15:24, Petr Lázňovský wrote: >> Sorry, 'windows batch' doesn't mean anything to me. > > http://en.wikipedia.org/wiki/Batch_file > > but wikipedia is reasonlessly turned off today Looks like you can get round this (at least on OS X / Safari 5.1) by pressing

Re: [sqlite] sql/tcl script

2012-01-16 Thread Tim Streater
On 16 Jan 2012 at 18:15, Stephan Beal wrote: > On Mon, Jan 16, 2012 at 7:12 PM, Bill McCormick wrote: > >> Is tcl the only scripting interface for SQLite? I'm just wondering what >> the options are. > There are few scripting languages which don't

Re: [sqlite] makefile for c

2012-01-15 Thread Tim Streater
On 15 Jan 2012 at 20:44, Bill McCormick wrote: > What is the problem with the shared lib stuff? > > Thanks!! > Black, Michael (IS) wrote, On 1/15/2012 2:27 PM: >> A simple one -- and please compile sqlite3.c into your program and make >> everybody happy. >> >> Forget the

Re: [sqlite] command line to get number of tables in sqlite

2011-12-21 Thread Tim Streater
On 21 Dec 2011 at 18:32, smallboat wrote: > I have a sqlite file. I would like to open it and know how many tables in it. > > What is the command line to open a sqlite file and get to know how many tables > in it? Thanks. See: http://www.sqlite.org/sqlite.html and:

[sqlite] Quickest way to get an answer

2011-11-11 Thread Tim Streater
My db has a column called "status". This can take one of 7 or so integer values from 0 to 7 or so. There are times when I need a quick answer to this question: are there any rows in the db for which status has value 0. I don't need to know how many, just whether there are any or not. What's the

Re: [sqlite] WAL mode is reliable?

2011-11-03 Thread Tim Streater
On 03 Nov 2011 at 14:02, Simon Slavin wrote: > On 3 Nov 2011, at 1:38pm, Paxdo Presse wrote: > >> How did you get concurrent connections? (about) > > This is related specifically to the web language I use (PHP) so it won't help > you if you're using something else. > >

Re: [sqlite] Unique id

2011-10-27 Thread Tim Streater
On 27 Oct 2011 at 22:04, Kees Nuyt <k.n...@zonnet.nl> wrote: > On Thu, 27 Oct 2011 21:47:17 +0100, Simon Slavin > <slav...@bigfraud.org> wrote: > >> >> On 27 Oct 2011, at 8:12pm, Tim Streater wrote: >> >>> Is there a way to get a unique id from a

[sqlite] Unique id

2011-10-27 Thread Tim Streater
Is there a way to get a unique id from a database without actually creating a new row? If I have: create table mytab (i integer primary key, j); then I could do (pseudo-code): insert into mytab (i) values (null); x = result of (select last_insert_rowid() from mytab;); for (n=0; n

Re: [sqlite] complete sqlite software

2011-10-22 Thread Tim Streater
On 22 Oct 2011 at 18:25, saeed ahmed wrote: > i want a software,something like microsoft's Access but no microsoft.a > software that can be used for making tables,queries and reports. Try Navicat for SQLite Lite (free). -- Cheers -- Tim

Re: [sqlite] DOMAIN new error code

2011-10-17 Thread Tim Streater
On 17 Oct 2011 at 10:00, Jean-Christophe Deschamps wrote: > At least it would gives a fairly good hint as to what to look for and > where to look. You know that some extension function was passed an > out-of-range argument during the course of the last operation. From >

Re: [sqlite] Malformed database error when using FTS3/4

2011-10-13 Thread Tim Streater
On 13 Oct 2011 at 16:59, Filip Navara wrote: > Reproduced on Windows, SQLite 3.7.8. Seems OK here, OS X 10.7.2: Second-Mini% sqlite3 wiggy -- Loading resources from /Users/tim/.sqliterc SQLite version 3.7.5 Enter ".help" for instructions Enter SQL statements terminated

[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,

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

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] 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-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 );

[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] 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,

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

[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] 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

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

[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] 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

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

[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] getting data by the column name.

2008-10-08 Thread Tim Streater
At 14:56 -0400 08/10/08, Igor Tandetnik wrote: >Shaun R. <[EMAIL PROTECTED]> wrote: >> Anybody help me out here, trying to grab column info based on the >> columns name. Examples i keep seeing people seam to use the colunm >> number but cant you access these values by the name? > >Not in

[sqlite] SQLite garbage collection in PHP

2008-10-06 Thread Tim Streater
If I'm doing, as it might be, the following in PHP: $dbh = new PDO ("sqlite:mydb"); $res1 = $dbh->query ("select ..."); $res11 = $res1->fetchAll (PDO::FETCH_ASSOC); Does anyone know at what point the variable $res1 becomes free for re-use? Is it immediately after the assignment to $res11

[sqlite] OS X precompiled command line binary

2008-07-30 Thread Tim Streater
The precompiled binary of the command line program for OS X appears not to have been built with a readline library. Is there any particular reason for this? (the version supplied with OS X Leopard (3.4.0), is so complied. Thanks, -- Tim ___

Re: [sqlite] Problem writing to database using PHP under OS X

2008-07-15 Thread Tim Streater
At 15:39 14/07/2008, John LeSueur wrote: >On Mon, Jul 14, 2008 at 4:28 AM, Tim Streater <[EMAIL PROTECTED]> >wrote: > > > I have a small script which shows this problem: if I run it from the > > command line I can read from and write to the database. If I run i

[sqlite] Problem writing to database using PHP under OS X

2008-07-14 Thread Tim Streater
I have a small script which shows this problem: if I run it from the command line I can read from and write to the database. If I run it in a browser it fails at the write with "General error: 14 unable to open database file" (having done the read OK first). The database has permissions

[sqlite] Do I need to free results variables?

2008-07-11 Thread Tim Streater
If I have something like the following PHP: $dbh = new PDO ("sqlite:" . $somename); $resq = $dbh->query ("select * from some_table"); $rest = $resq->fetchAll (); then do I need to do any cleanup on $resq before re-using it, such as setting to NULL (seems to be recommended for reuse of $dbh)?

Re: [sqlite] counting tables

2008-07-04 Thread Tim Streater
At 18:02 03/07/2008, Simon Davies wrote: >Hi Tim, > >select count(*) from sqlite_master; > >will return 0 on a brand new db > >Rgds, >Simon Thanks - that's a handy pointer. At 18:04 03/07/2008, Igor Tandetnik wrote: >Tim Streater <[EMAIL PROTECTED]> >wro

[sqlite] counting tables

2008-07-03 Thread Tim Streater
Hi, I have a PHP script that I run in Terminal under OS X, which opens an sqlite db and works on it. Trouble is, if the db doesn't exist then the PHP library silently creates an empty db with the given name. Given this, I need to detect that the empty db has been created, delete it, and exit.

<    1   2   3