[sqlite] How do I contribute a port?

2012-01-30 Thread David Henry
I've just managed to port SQLite to an 50MHz ARM with 256KB ROM and 96KB RAM. It was an interesting exercise, not too painful and quite successful. I have tables of 1 rows, foreign keys, indices etc. Performance is reasonable and it seems to be stable. At this stage I'd like to contribute wh

Re: [sqlite] ftruncate implementation

2012-01-24 Thread David Garfield
, without actually zero filling anything. Having said that, I would expect certain operating systems (like DOS) to actually do the zero-filling and complete it before returning from the call. --David Garfield On Tue, Jan 24, 2012 at 14:00, Simon Slavin wrote: > > On 24 Jan 2012, at 6:51pm,

Re: [sqlite] ftruncate implementation

2012-01-24 Thread David Garfield
>From the ftruncate page: "If the file size is increased, the extended area shall appear as if it were zero-filled". It doesn't have to write zeros, just act like it did. --David Garfield On Tue, Jan 24, 2012 at 08:19, Simon Slavin wrote: > > On 24 Jan 2012, at 6:43am, D

Re: [sqlite] replying to thread

2012-01-24 Thread David Henry
Testing with Microsoft Outlook ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] replying to thread

2012-01-23 Thread David Henry
How do I reply to a thread? I put Re: Re: [thread title] into the subject but it comes out as a new thread e.g. I put "Re: Re: [sqlite] ftruncate implementation" in the subject field but a new thread "[sqlite] ftruncate implementation" was started. ___

Re: [sqlite] ftruncate implementation

2012-01-23 Thread David Henry
I am working without an operating system so there are no other agents trying to steal data. Bearing that in mind, is it still necessary to actually write zero data to the sectors allocated? Is SQLite expecting it? ___ sqlite-users mailing list sqlite-use

Re: [sqlite] Minimum RAM requirements (Richard Hipp)

2012-01-22 Thread David Henry
Thanks for the tip which seems to do the trick. When using MEMSYS3 I was able to create a table with a primary key but inserting rows ran out of memory after 170 rows. Now, with MEMSYS5, I inserted 5000 rows, no problem. ___ sqlite-users mailing list sq

[sqlite] ftruncate implementation

2012-01-22 Thread David Henry
According to the posix definition of "ftruncate" , a file is made larger by writing zeroes up to the size desired. My implementation of Fat File System can quickly extend a file by allocating more sectors, but will take a long time to write all those new sectors with zeroes. So, is zero filling a

Re: [sqlite] Wanted - a straightforward 'grid' data entry tool for sqlite

2012-01-18 Thread David L
ntation/How_Tos/Using_SQLite_With_OpenOffice.org Regards, David Chris Green skrev 2012-01-17 17:05: I'm after an application which will allow me to enter data into a sqlite database using a 'grid' layout of the data. I.e. I want the existing contents of the database displayed as a table and I

[sqlite] Minimum RAM requirements

2012-01-17 Thread David Henry
I asked this question on the sql_dev list which Richard Hipp told me that this list was the proper place. I asked whether it is possible to execute SQLite in 80K of RAM. Well, I can now tell you that you can, just about. My environment has no malloc so I used the MEMSYS5 method of internal mal

Re: [sqlite] Bin parameters by name - generic function

2012-01-17 Thread David Garfield
ant to use the datatype listed on the column as a hint, then I can't help you. --David Garfield On Tue, Jan 17, 2012 at 19:32, Bill McCormick wrote: > I'm trying to write a function with a sig like this: > > int BindParameter(sqlite3_stmt* stmt, int sqlType, const char* pname,

Re: [sqlite] Using non-aggregate columns in group by (with an additional issue)

2012-01-14 Thread David Garfield
x27;t know how this compares in terms of performance with Igor's solution. --David Garfield On Fri, Jan 13, 2012 at 06:07, Dilip Ranganathan wrote: > I have a table that looks like something like this: > >timestampval

Re: [sqlite] Named parameters and spaces.

2012-01-12 Thread David Garfield
only so that the SQL command and the API user can be matched up, particularly when one or more value need to be reused. --David Garfield On Wed, Jan 11, 2012 at 19:01, Steven Michalske wrote: > On Tue, Jan 10, 2012 at 4:11 PM, Simon Slavin > wrote: > > > > On 10 Jan 2012,

Re: [sqlite] primary key and rowid

2011-12-19 Thread David Garfield
his? (I will admit that it doesn't really make sense for a multi-column constraint.) --David Garfield ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Calculating MSO

2011-12-16 Thread David Bicking
a meeting where I was told "it can't be done efficiently" is an acceptable answer at this time.I just need to make sure I'm not missing some obvious way to get the answer out of the data. David From: Igor Tandetnik To: sqlite-users@sqli

[sqlite] Calculating MSO

2011-12-16 Thread David Bicking
Cust        MSO 01    2.3   = (3+(100-120)/60)) 02    3.3   = (4+(50-60)/15))     Hopefully I described that in a meaningful way. Is it possible to do that efficiently or at all using SQL? Thanks, David ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Command line option equivalent for .read

2011-12-10 Thread David Walker
-mode csv (and by implication a -mode tcl where there is not -tcl) Don't get me wrong this is not a major whinge - I love sqlite and appreciate the effort of the developers put into maintaining it but as it grows having a consistent single command set for .commands and options would be a

[sqlite] Command line option equivalent for .read

2011-12-08 Thread David Walker
Hi, Having played around with a shell script that calls SQLite I have noticed that I can something like .separator STRING at the SQLite prompt .mode line or I can do sqlite3 -separator STRING at the command line sqlite3 - line This is both useful and cons

Re: [sqlite] union-having bug

2011-12-04 Thread Gillman, David
Is this expected behavior? (The failure of my query to return a row.) David -Original Message- From: Kit [mailto:kit.sa...@gmail.com] Sent: Saturday, December 03, 2011 5:24 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] union-having bug 2011/12/3 Gillman, David

Re: [sqlite] union-having bug

2011-12-02 Thread Gillman, David
from (select 1 ind, 0 foo, 1 bar union select 1 ind, 1 foo, 0 bar) group by ind) where bar > 0; ind|foo|bar 1|1|1 sqlite> -Original Message- From: Gillman, David [mailto:dgill...@akamai.com] Sent: Friday, December 02, 2011 6:37 PM To: sqlite-users@sqlite.org Subject: [sqlite] u

[sqlite] union-having bug

2011-12-02 Thread Gillman, David
Hi, Is this behavior known? The third query returns no rows even though bar = 1. sqlite> select region, sum(edge) edge, sum(infra) infra from (select 1 region, 0 edge, 1 infra union select 1 region, 1 edge, 0 infra) group by region;region|edge|infra 1|1|1 sqlite> select ind, sum(foo) foo, sum(

[sqlite] SQLite Locking Issue From Another Process

2011-11-23 Thread David Levinson
We have Process A which writes constantly to our SQLite database and we have Process B which occasionally reads from this same database. When Process B opens the database for read-only access and performs a select statement on the database it causes Process A to get SQLITE_BUSY errors when executin

Re: [sqlite] PHP & SQLite examples

2011-11-14 Thread David Garfield
important in writing any software, but in communications, you can't even trust yourself.) http://xkcd.com/327/ --David Garfield Simon Slavin writes: > > On 14 Nov 2011, at 5:53pm, Dotan Cohen wrote: > > > I recommend against formulating the SQL statements in Javascript. >

[sqlite] sql server management studio like tool for SQLite

2011-11-03 Thread David Hubbard
Is there any tool for SQLite like sql server management studio? We are looking at using SQLite and I have no expireince with it but would like an easy to use tool to use with SQLite that can perform the same functions as SSMS. Or can you connect SQLite to SSMS? Thanks any help received will be app

Re: [sqlite] Slow INDEX

2011-11-02 Thread David Bicking
ons to open and read the file, perhaps by making a copy of the file, then try your inserts. If the time does goes back down, then you know it is file cache issues. David ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/m

Re: [sqlite] Help with sqlite3OsRead - porting to a new OS

2011-10-25 Thread David Garfield
Also, if this is debugger output (as it appears), it could be that an optimizer is confusing the parameters. I see that all the time on GCC i386 when I set a breakpoint at the start of a function. --David David Garfield writes: > Sounds like it could be a difference in calling convent

Re: [sqlite] Help with sqlite3OsRead - porting to a new OS

2011-10-25 Thread David Garfield
Sounds like it could be a difference in calling convention... Check compile options and function declaration modifiers. --David Stuart Thomson writes: > Hi, > > I'm in the middle of porting sqlite3 to a new Operating System and have come > across a problem with the sqlite3O

Re: [sqlite] Potential bug: "insert into X select * from Y" ignores the "ON CONFLICT REPLACE" conflict-clause

2011-10-25 Thread David
iling list earlier this year: http://www.sqlite.org/src/tktview?name=6284df89de Hopefully, a member of the sqlite dev team will acknowledge this bug soon. -- Regards, David ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.or

Re: [sqlite] Order by creating function is not sorting for input order and alphabet

2011-10-24 Thread David Garfield
at it. (Actually... should it really be a "string" in the first place?) 3) digits[] may be insufficient in some cases (though not in your samples). --David Garfield ChingChang Hsiao writes: > > The purpose of function antok is that solve the problem of "order by cl

Re: [sqlite] Doc bug in on-line description of round() function

2011-10-21 Thread David Garfield
ependent or undefined behavior. --David Garfield Peter Aronson writes: > Here's where I let my pedantic side out to play.  The documentation for the > round() function on the SQLite website at > http://www.sqlite.org/lang_corefunc.html says: > > "The round(X,Y) function r

Re: [sqlite] Slow JOIN on ROWID

2011-10-14 Thread David Bicking
the rowid index, and thus has to sort behind the scenes as you say. If it is using an index to find the data, I believe you can do +data = 10, which will invalidate the index use on data. (Hope I remember that right..) David ___ sqlite-users mailin

Re: [sqlite] sqlite3_open_v2 vs. *ppDb=NULL

2011-10-12 Thread David Garfield
-dangerous. That sqlite3_errmsg() had to guess and guessed wrong is not surprising. --David Garfield Krystian Bigaj writes: > Hi, > > Documentation says that: > > "The only exception is that if SQLite is unable to allocate memory to hold > the sqlite3 object, a NULL wil

Re: [sqlite] Using COUNT(*) in unusual circumstances

2011-10-07 Thread David Garfield
re are. Consider: SELECT COUNT(*) FROM t1, t2; SELECT (SELECT COUNT(*) FROM t1) * (SELECT COUNT(*) FROM t2); Of course, those are special cases. Application programmers should probably watch for this kind of thing, but it probably wasn't what the programmer wanted to count in the first pl

Re: [sqlite] Using COUNT(*) in unusual circumstances

2011-10-07 Thread David Garfield
WHERE or HAVING clauses that refer back to named results could be a problem with the simple replacement. SELECT a,b,a+b AS ab FROM t WHERE ab>10 Igor's suggestion work there too. --David Garfield Simon Slavin writes: > I'm trying to write some code which has to be u

[sqlite] Meaning of sqlite3_wal_checkpoint_v2 parameters

2011-10-06 Thread David Barrett
is email; I welcome you advice. Thanks! -david -- We have a 3.7.7.1 database named "main.db", which is in WAL mode, with a corresponding "main.db-wal" file. The main.db file is 13519440896 bytes (about 13G

Re: [sqlite] Porting a simple logon script to SQLite3 from MySQL

2011-10-05 Thread David Garfield
0 are magic for a INTEGER PRIMARY KEY AUTO_INCREMENT column. In SQLite, only null is magic for a INTEGER PRIMARY KEY column. Use NULL instead of '0' in both platforms. --David Garfield ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Query Problems - Keyword? Encoding?

2011-09-29 Thread David Garfield
ng the key as text in the first place. Or use a binary blob instead of a hex dump of it, and use (note the "x"): SELECT * FROM recordings WHERE "key" = x'4df0247ce1a97685a782d2cb051b48ed952e666c'; --David Garfield Eric Anderson writes: > The below statement retur

Re: [sqlite] feed "endless" data into sqlite, thru a shell script

2011-09-27 Thread David Garfield
Patrick Proniewski writes: > On 27 sept. 2011, at 20:14, David Garfield wrote: > > > Any entry in a pipe could be buffering. In a quick test here, awk is > > buffering. To find the buffering, try using the pieces up to a given > > stage with " | cat " added at

Re: [sqlite] feed "endless" data into sqlite, thru a shell script

2011-09-27 Thread David Garfield
done only to a terminal. I think the only easy way to externally disable the buffer is to wrap the program in a pseudo-tty. Alternatively, look for an option that lets you explicitly unbuffer. (for instance, in perl, do: $| = 1; ) --David Garfield Patrick Proniewski writes: > On 27 sept. 201

Re: [sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-26 Thread David Garfield
ike that in the x86 real mode "large" model size_t can be unsigned int or long, and ptrdiff_t must be long. [Personally, I've always been disappointed that the 386 and later 32 bit (and larger) OSes don't seem to support anything but "tiny" model.] Jan Hudec writes: &g

Re: [sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-26 Thread David Garfield
ol, or a useful third variant. One interesting thought: It might actually make the functions faster to not have to count the length of strings. --David Roger Binns writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 09/26/2011 01:13 PM, David Garfield wrote:

Re: [sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-26 Thread David Garfield
replace the built-in functions. You should not have to. --David Garfield ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-26 Thread David Garfield
Roger Binns writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 09/23/2011 05:51 PM, David Garfield wrote: > >> SQLite's API supports both (mostly). Internally, you must use one or > >> the other (or hideously duplicate code), > > No

Re: [sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-23 Thread David Garfield
Roger Binns writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 09/23/2011 08:47 AM, David Garfield wrote: > > But that is the point. Strings are generally defined in two ways. > > Either: > > > > 1) a pointer, and count every byte up to bu

Re: [sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-23 Thread David Garfield
umns that are partly text and would like to have the text portions at least be visible. I suspect that at least part of this problem came from SQLite's history as a TCL add-on. I suspect TCL, at least in it's early days, didn't allow NUL in a string. --David Garfield Richard Hip

[sqlite] Newbie starting off question

2011-09-23 Thread david
Thanks guys It is an embedded system so I have full control of everything. Due to memory size constraints the ideal thing for me would be to use a shared library. According to the first post, sharing a library between cgi modules and an application should not be a problem? David

[sqlite] NUL handling bugs (was Re: c-api document suggestion)

2011-09-22 Thread David Garfield
two 20006F6E6520 006F6E65 two 00206F6E6520 00206F6E65 Without the hex() calls, you can't even tell what worked and what didn't. --David Garfield Mira Suk writes: > On 9/21/201

[sqlite] Newbie starting off question

2011-09-22 Thread david
too -- so this might be a stupid question -- I am not sure ) Or perhaps one library for CGI and one for the application? Or perhaps even a library for the cgi and the application have the api as part of it? Any suggestions would be most welcome Thanks David

Re: [sqlite] Problems

2011-09-14 Thread David Holtkamp
2011 at 2:29 PM, Richard Hipp wrote: > On Tue, Sep 13, 2011 at 2:23 PM, David Holtkamp wrote: > >> Hello, >> I have been using Membase (a nosql database), which uses sqlite3 to >> persist data to disk and have run into some problems when attempting >> to backup

Re: [sqlite] Problems

2011-09-13 Thread David Holtkamp
Tue, Sep 13, 2011 at 2:29 PM, Richard Hipp wrote: >> On Tue, Sep 13, 2011 at 2:23 PM, David Holtkamp wrote: >> >>> Hello, >>> I have been using Membase (a nosql database), which uses sqlite3 to >>> persist data to disk and have run into some problems when at

[sqlite] Problems

2011-09-13 Thread David Holtkamp
y help would be greatly appropriated. Thanks! David ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug in GCC - suggestions sought for a backup tool chain

2011-08-23 Thread David Garfield
r the level for this optimization has changed. Having said this, it may well be reasonable to leave the test in place in case you someday choose to stop using the struct hack (which is undefined behavior as well), knowing that the compiler will optimize out the dead test. --David Garfield Rich

Re: [sqlite] EINTR and write() in os_unix.c

2011-08-18 Thread David Garfield
I think you are right, that it is too easy, at least on its own. You also should account for partial writes. I think the general rule is: if it wrote anything, it tells you how much it wrote, which can be everything you asked it to write, or less. If it wrote nothing, it usually returns -1 and se

[sqlite] Insert rows into a foreign key table

2011-08-15 Thread David Westbury
For the two tables shown here, what sqlite INSERT statement would add a new Order for person Hansen? Is it possible to add a new order with one sql statement or does it require two statements? The only way I have found to add a new order is to first SELECT the P_Id for Hansen from the Persons

Re: [sqlite] Maximum number of tables in a data file

2011-08-09 Thread David Garfield
to other databases are just ways to waste ones time. Having said that, let me present a database for consideration: Any filesystem. Split the hex of the MD5 into directory levels and make what you need. Might be slower, particularly with some OSes, but the tools are e

Re: [sqlite] group_concat and empty strings

2011-08-03 Thread David Garfield
ng concatenated is a zero length string or blob. --David Garfield Jan writes: > On http://www.sqlite.org/cvstrac/tktview?tn=3806 > this bug is fixed. > > But I still get a NULL with group_concat(distinct x) with the latest > windows sqlite shell: > > SQLite version 3.7.7.1

Re: [sqlite] LevelDB benchmark

2011-07-27 Thread David Garfield
batches. --David Garfield Simon Slavin writes: > > On 28 Jul 2011, at 2:22am, Stephan Wehner wrote: > > > There are some benchmark's at > > http://leveldb.googlecode.com/svn/trunk/doc/benchmark.html > > > > I don't have anything to point to, but I t

Re: [sqlite] Hidding records from the application

2011-07-16 Thread David Bicking
deeply suspect that is not the complete story. David On 07/16/2011 12:18 PM, san long wrote: > Thanks for replies. > I want to make things clear. there are some rules in my system, such > as : process whose name is proc_host can see all the records, and > process whose name is proc_c

Re: [sqlite] Hidding records from the application

2011-07-16 Thread David Bicking
you are really trying to do, so I may be off by a mile. David On 07/16/2011 12:01 AM, san long wrote: > sqlite3 support a trigger on SELECT ? View is a good solution, but I > want to let different process see different records, like: > pid A sees rowid 1,2 > pid B sees rowid 1,3 > &g

Re: [sqlite] Ensure that query acts on PRE-SORTED tables

2011-07-01 Thread David Bicking
ECT pos FROM T_y WHERE txt = 'cogs') AND (SELECT pos FROM T_y WHERE txt = 'sg&a expenses'); David --- On Fri, 7/1/11, e-mail mgbg25171 wrote: > From: e-mail mgbg25171 > Subject: Re: [sqlite] Ensure that query acts on PRE-SORTED tables > To: "General

Re: [sqlite] Ensure that query acts on PRE-SORTED tables

2011-07-01 Thread David Bicking
u what you want: SELECT POS FROM T_x WHERE POS BETWEEN (SELECT POS FROM T_x WHERE txt = 'x1') AND (SELECT POS FROM T_x WHERE txt = 'x2'); Hopefully I have guessed your need somewhat correctly, David --- On Fri, 7/1/11, e-mail mgbg25171 wrote: > From: e-mail mgbg2

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread David Bicking
Since none of the statements is a SELECT, as far as I know the callback would never be called. You can pass a zero as the callback address. get_table will also handle all the statements in one pass, but will return an empty able, so you might as well use exec. David On 06/21/2011 07:59 AM, e

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread David Bicking
ointed out. Secondly, prepare only prepares one statement, so you would have to loop through the statements. My C is rusty, but I think it is something like: tail = sql.c_str(); while (tail) { rc = sqlite3_prepare(db, tail, strlen(tail), &stmt, &tail)

Re: [sqlite] how do I select on a field that contains text and digits eg: "chr19:200"

2011-06-16 Thread David Lyon
Thank you for everyones help, it was most useful much appreciated ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Anyway to order query results by "in" list?

2011-06-15 Thread David Garfield
ess you know a full table scan is acceptable. --David Garfield Michael Stephenson writes: > Wondering if anyone has a way to execute a query that selects rows based on > a list of rowids and returns the results in the order of the rowids passed > in. > >

[sqlite] how do I select on a field that contains text and digits eg: "chr19:200"

2011-06-15 Thread David Lyon
normally if I want to select within a range of numbers I can do something like this: sqlite3 $db "select * from SNPS where $Start >= 1 and $Start <= 10" gives: 1 100 222 1123 1122 etc. how do I do the same select statement where the field are pre-appended with a word and a colon eg "c

Re: [sqlite] Dynamic SQL for SQLite?

2011-05-11 Thread David Garfield
Wonderful. The other answer is that one probably should not have a table with seven columns and one row when one could have a table with two columns (day of week and value) and seven rows. Like the view you are suggesting. --David Nico Williams writes: > On May 11, 2011 7:14 PM, "John

Re: [sqlite] Advice to choose an index for quad tree?

2011-05-03 Thread David Garfield
round imagery. --David Garfield Enrico Thierbach writes: > Hi, > > I think an R Tree is what you are after. > > http://www.sqlite.org/rtree.html > > /eno > > ___ > sqlite-users mailing list > sqlite-users@sqlit

[sqlite] query to find mixed values

2011-04-26 Thread David Bicking
would I craft a query to return REQ3? At this point, I haven't a clue, so any help would be appreciated. Thanks, David ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Foreign keys bypassed on insert?

2011-04-24 Thread David L
Hello Sqlite-users! I have stumbled upon the fact that foreign keys are not always enforced. Specifically, that happened when I used the INSERT statement with a SELECT clause, which apparently caused invalid values to be inserted. How else would you explain the following?: PRAGMA foreign_keys

[sqlite] Documentation error was Re: date field with default current date

2011-04-21 Thread David Garfield
http://www.sqlite.org/lang_datefunc.html This page has an error in documenting the range of values when using modifier 'unixepoch'. It says the limit is 10675199167. There should be one more digit in that to get the documented year 5352 result. --David Garfield Mihai Militaru writes

Re: [sqlite] Request for help with SQLite Query to return missing Date/Time Ranges

2011-04-20 Thread David Garfield
they are uniform). --David Garfield Simon Slavin writes: > > On 21 Apr 2011, at 12:34am, Andrew Lindsay wrote: > > > I am trying to search an SQL database that is meant to have entries logged > > every minute for a period of approximately 15 months. > > > >

Re: [sqlite] Multiple Match statements per query

2011-04-19 Thread David White
Database abstraction, scope, multi-threading. A few stack layers out is my loop requesting each record by rowid. And there's no predicting which thread will make the request. Likely, there will be 50 threads making very similar requests at the same time. If I could clone the statement, then I

Re: [sqlite] updating records in table A from joined records in table B

2011-04-01 Thread David Garfield
is no multi-table update idiom in SQLite because there isn't one in SQL. --David Robert Poor writes: > I'd like to be able to update specific records in table A from joined > records in table B. So for example: > > CREATE TABLE "table_a" ("key" intege

Re: [sqlite] Insert BLOB data from the command line

2011-03-30 Thread David Garfield
Nice. For general use, you may also need to include duplicates in "od". For the GNU coreutils and Solaris 10 implementations, this would be the -v or --output-duplicates option. --David Garfield Kees Nuyt writes: > On Wed, 30 Mar 2011 12:51:11 -0400, "Santin, Gloria" &g

Re: [sqlite] Bug: rtree2 tests fail due to incorrect format string in rtree.c

2011-03-04 Thread David Gilbert
On Wed, Mar 02, 2011 at sometime, Jay A. Kreibich wrote: > On Tue, Mar 01, 2011 at 03:21:58PM +0000, David Gilbert scratched on the wall: > > for(jj=0; jj >sqlite3_snprintf(512-nCell,&zCell[nCell]," > > %f",(double)cell.aCoord[jj].f); > > >

[sqlite] Bug: rtree2 tests fail due to incorrect format string in rtree.c

2011-03-02 Thread David Gilbert
Hi, I ran the sqlite3 test suite on ARM Linux (Ubuntu) and got a set of failures in the rtree2 set of tests, including the following set: rtree2-rtree_i32.1.3 rtree2-rtree_i32.1.5.0.2 rtree2-rtree_i32.1.5.10.2 rtree2-rtree_i32.1.5.20.2 rtree2-rtree_i32.1.5.30.2 rtree2-rtree_i32.1.5.40.2 rtree2-r

Re: [sqlite] will FTS speed up [LIKE '%foo%'] searches? or: how does iTunes do it?

2011-02-18 Thread David M. Cotter
> Did you read the page at the URL I gave ? It answers the question. yes the page shows an extremely unhelpful comparison: > SELECT count(*) FROM enrondata1 WHERE content MATCH 'linux'; /* 0.03 seconds > */ > SELECT count(*) FROM enrondata2 WHERE content LIKE '%linux%'; /* 22.5 seconds > */ the

Re: [sqlite] will FTS speed up [LIKE '%foo%'] searches? or: how does iTunes do it?

2011-02-16 Thread David M. Cotter
>> SELECT p.piIx FROM playlist p JOIN song s ON p.soID = s.soID WHERE p.plID = >> 99662 AND (s.name LIKE "%love%" OR s.arts LIKE "%love%" OR s.pUSD LIKE >> "%love%" OR s.pbls LIKE "%love%" OR s.genr LIKE "%love%") ORDER BY s.pbls >> ASC, s.name ASC, s.albm ASC, p.piIx ASC > > Good grief, no tha

Re: [sqlite] will FTS speed up [LIKE '%foo%'] searches? or: how does iTunes do it?

2011-02-16 Thread David M. Cotter
>> iTunes has "update search results as you type" speed even when you have a >> hundred thousand songs and you're searching on a partial string on all meta >> data columns. >> >> how on earth do they do that? >> >> i'm under the impression it uses CoreData, which in turn uses SQLite under >> t

[sqlite] will FTS speed up [LIKE '%foo%'] searches? or: how does iTunes do it?

2011-02-15 Thread David M. Cotter
iTunes has "update search results as you type" speed even when you have a hundred thousand songs and you're searching on a partial string on all meta data columns. how on earth do they do that? i'm under the impression it uses CoreData, which in turn uses SQLite under the hood. how can i make

Re: [sqlite] BUG (3.7.5): identifier quotation characters get part of column names for certain statements

2011-02-10 Thread David Bicking
pipe up with an opinion that it should be done another way. There were pragmas to try to get the column names to match different expectations. In the end, they decided to just call it undefined and let the user use AS to get what they wanted. I think that was the right decision. David ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bi-directional unique

2011-02-09 Thread David Bicking
I don't think this will work. xor(6,1) = 7 and xor(4,3) = 7, so you would fail to insert proper pairs. Or am I missing something? (At least I assume that the integers are not limited to just 1 2 or 3 as in the examples. David On 02/09/2011 05:58 PM, Samuel Adam wrote: > On Wed, 09

Re: [sqlite] threads and transactions

2011-02-06 Thread David M. Cotter
complete and there are no errors or aborts do i then just "merge" the store DB with the main DB, but this depends on the ability to run a single "merge" command? is there such a thing? On Feb 6, 2011, at 9:56 AM, Simon Slavin wrote: > > On 6 Feb 2011, at 5:42pm, David M.

Re: [sqlite] threads and transactions

2011-02-06 Thread David M. Cotter
> If you don't need this behaviour because you're confident you'll never get a > clash, then you could accumulate your INSERTs in memory, then blast through > them when you would previously have just done the COMMIT. i will never have a clash because i manage the primary keys myself. is there a

Re: [sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
forgive my not understanding this but i'm trying to be extremely clear and i am not sure from your answer whether you have understood my question. > In SQLite every write is in a transaction whether you declare one with BEGIN > or not. If you don't declare a transaction, SQLite invisibly surro

Re: [sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
quot;begin > immediate" or by executing insert/update/delete after "begin") no > other connection can start a writing transaction (it still can do > read-only transactions for a while). > > If you need a different behavior you need to use some other DBMS. > > >

Re: [sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
> Transactions are per-connection and have nothing to do > with threads. If you want different transactions in each thread you > need to make one connection for each thread. But those transactions > won't be able to execute simultaneously. so if i open a separate connection on each thread then eac

[sqlite] threads and transactions

2011-02-05 Thread David M. Cotter
i'm sure this topic has been beaten to death but i just really want to make sure. i'm using ONE database, and one handle to it on all threads here's a theoretical timeline -- 1) thread 1 begin transaction do bunches of stuff 2) thread 2 begin transaction do bunches of stuff 3)

Re: [sqlite] Query question

2011-01-25 Thread David Burström
I'm no expert, but I'd do it with: SELECT COUNT(*) AS count FROM ratingsTable GROUP BY mtId ORDER BY count DESC LIMIT 1; :-David Burström On 01/25/2011 03:49 PM, Puneet Kishor wrote: > > Ian Hardingham wrote: >> Hey guys. >> >> I have the following table: >

Re: [sqlite] JOIN bug in 3.7.2, not in 3.6.22

2011-01-17 Thread David Burström
Dan, Richard, Igor, thanks for your input, and yes, it seems as if the gamble is no longer safe. Hopefully I'm the only one that has run into this side effect ;) :-David On 01/17/2011 04:57 PM, Igor Tandetnik wrote: > David Burström wrote: >> SELECT starttime, endtime from e

Re: [sqlite] JOIN bug in 3.7.2, not in 3.6.22

2011-01-17 Thread David Burström
I just tried the 3.7.4 binary on Linux, and the bug is still around. :-David On 01/17/2011 04:25 PM, Black, Michael (IS) wrote: > This may be the patch that fixes your problem... > http://www.sqlite.org/src/info/ece641eb89 > > Was released in 3.7.3 > > Michael D. Black

[sqlite] JOIN bug in 3.7.2, not in 3.6.22

2011-01-17 Thread David Burström
Hello all! I stumbled across this strange bug during Android development on 2.2.1 late last night. Please run the following snippet in SQLite 3.7.2 and 3.6.22 to compare the differences. The comments shows what alterations you can make to make the query return the expected result. :-David

Re: [sqlite] does sqlite differ between char, varchar and text?

2010-12-16 Thread David Bicking
Oh, and as I recall, sqlite2 completely ignored the type declaration. It stored what you typed in the schema, but did nothing with it. I am pretty sure that sqlite3 treats text, char and varchar completely the same. It ignores the number after char(x) or varchar(x). David --- On Thu, 12/16/10

Re: [sqlite] does sqlite differ between char, varchar and text?

2010-12-16 Thread David Bicking
If I recall correctly, sqlite2 stores everything as text. It doesn't have a concept of affinity. Everythign is text and it will convert anything as needed. David --- On Thu, 12/16/10, Artur Reilin wrote: > From: Artur Reilin > Subject: [sqlite] does sqlite differ between char,

Re: [sqlite] Reading a text file and insert to sqlite tables

2010-12-09 Thread David Bicking
aps to the fields you want to store, this is the best pseudo code I can give you. Hopefully it helps, David --- On Thu, 12/9/10, yazdan asgari wrote: > From: yazdan asgari > Subject: Re: [sqlite] Reading a text file and insert to sqlite tables > To: "General Discussion of SQLite

Re: [sqlite] Concern over runtime memory growth?

2010-12-07 Thread David Abdurachmanov
: 1,567,208 bytes in 7,993 blocks==3237==    still reachable: 364,632 bytes in 3,045 blocks==3237==         suppressed: 0 bytes in 0 blocks -david > From: lynton.gr...@logosworld.com > To: sqlite-users@sqlite.org > Date: Wed, 8 Dec 2010 07:58:14 +0200

[sqlite] Transaction Size

2010-11-14 Thread David Peters
execute almost 1 million statements (inserts and updates) in a single block. I am currently executing blocks of 50,000 statements in a single transaction but that value may be too low. Thank you very much. Regards, David ___ sqlite-users mailing list sqlite

Re: [sqlite] SQLITE3 - sqlite3_step bug?

2010-11-13 Thread David Levinson
riday, November 12, 2010 1:17 PM To: David Levinson; sqlite-users@sqlite.org Subject: Re: SQLITE3 - sqlite3_step bug? On Fri, Nov 12, 2010 at 1:06 PM, David Levinson wrote: I have an 11GB database and when I attempt to query the database for the max(column) value the code within sqlite3_step() gets

Re: [sqlite] Ratio of test code to database code

2010-11-12 Thread Dr. David Kirkby
On 11/11/10 02:32 PM, Simon Slavin wrote: > > On 11 Nov 2010, at 1:41pm, Dr. David Kirkby wrote: > >> On 11/10/10 04:28 PM, Roger Binns wrote: >> >>> The SQLite developers decided their library will always be reliable and >>> greatly care about data integri

<    5   6   7   8   9   10   11   12   13   14   >