Re: [sqlite] Deterministic random sampling via SELECT

2019-11-07 Thread Doug Currie
On Thu, Nov 7, 2019 at 4:23 PM Richard Damon wrote: > > One thought would be to generate a ‘hash’ from part of the record, maybe > the record ID, and select records based on that value. The simplest would > be something like id%100 == 0 would get you 1% of the records. That > admittedly isn’t

Re: [sqlite] [SPAM?] Re: [EXTERNAL] Re: Should SQLite distinguish between +0.0 and -0.0 on output?

2019-06-14 Thread Doug Currie
On Fri, Jun 14, 2019 at 7:16 AM R Smith wrote: > > What I was objecting to, is claiming (in service of suggesting the > use-case for -0.0), [...] > > I'll be happy to eat my words if someone can produce a mathematical > paper that argued for the inclusion of -0.0 in IEEE754 to serve a >

Re: [sqlite] [SPAM?] Re: [EXTERNAL] Re: Should SQLite distinguish between +0.0 and -0.0 on output?

2019-06-13 Thread Doug Currie
> > I do not know if this is the result case in any of the programming > languages, but in Mathematical terms that is just not true. > The related IEEE 754 rules are described here: https://en.wikipedia.org/wiki/Signed_zero e ___ sqlite-users mailing

Re: [sqlite] [SPAM?] Re: [EXTERNAL] Re: Should SQLite distinguish between +0.0 and -0.0 on output?

2019-06-13 Thread Doug Currie
> > > Except by the rules of IEEE (as I understand them) > > -0.0 < 0.0 is FALSE, so -0.0 is NOT "definitely left of true zero" > Except that 0.0 is also an approximation to zero, not "true zero." Consider that 1/-0.0 is -inf whereas 1/0.0 is +int e

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

2018-03-16 Thread Doug Currie
0 ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Question about Practicality of Embedding SQLite on Cortex-M4 Processor

2018-03-02 Thread Doug Currie
On Fri, Mar 2, 2018 at 2:46 PM, Obrien, John J wrote: > [...] > > To summarize, my question is regarding what direction I should ask the > hardware vendor to take. Does it make sense for them to spend time > optimizing the SAM4S for SQLite or should we consider another

Re: [sqlite] difference between 'ID IS NULL' and 'ID = NULL'

2018-01-05 Thread Doug Currie
Cezary is correct, NULL is not equal to NULL, though NULL is NULL. sqlite> select NULL IS NULL; 1 sqlite> select NULL = NULL; sqlite> e ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Simple web query tool

2017-02-01 Thread Doug Currie
On Wed, Feb 1, 2017 at 11:10 AM, Jay Kreibich wrote: > I'm looking for an *extremely* simple web tool that will allow me to > configure a dozen or so stored queries, which people can then select and > run on an internal server. While I wouldn't call it extremely simple, the

Re: [sqlite] Simplify multiple use of value in a trigger

2017-01-07 Thread Doug Currie
On Sat, Jan 7, 2017 at 9:27 AM, Gan Uesli Starling wrote: > So I'm trying to accumulate data for state/prov inside of USA, Canada and > Mexico, and country for the rest of the world. > > Since country and state from the same update are factors in incrementing > each of four

Re: [sqlite] Datatype for prices (1,500)

2016-11-30 Thread Doug Currie
On Wed, Nov 30, 2016 at 5:25 PM, Nico Williams wrote: > On Wed, Nov 30, 2016 at 02:22:42PM -0600, John McKown wrote: > > > > [...] every RDMS "should" implement Decimal Floating Point. > > You could argue that every programming language needs that. What makes > SQL more

Re: [sqlite] Bug: SQLite's include guards are reserved identifiers

2016-07-09 Thread Doug Currie
On Sat, Jul 9, 2016 at 12:05 PM, Keith Medcalf wrote: > > [...] Most API headers do the same thing. Even the standard library does > it, in most compilers. [...] Sure, that's why they're reserved! So user code and the C compiler's library implementation don't clash. The

[sqlite] File Locking Status

2016-03-08 Thread Doug Currie
> Is it possible to tell if SQLite has a database file locked? Not through > OS tools, but from System.Data.SQlite? If you can execute BEGIN EXCLUSIVE TRANSACTION and get back SQLITE_OK then there were no locks on the database. Of course you will then need to ROLLBACK. Note that this

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-02 Thread Doug Currie
On Wed, Mar 2, 2016 at 4:42 PM, R Smith wrote: > > > Personally, unless your space is constrained, I would simply save the > numbers as strings, perhaps Hex or BCD with leading chars and convert as > needed. This would sort correctly without tricks and not do much worse for > space. (Base64 would

[sqlite] insert in sqlite (returning value for inserted row)

2015-04-01 Thread Doug Currie
Suraj, Don't use the same database connection in multiple threads. Each thread should use its own connection. Then last insert rowid is predictable. e On Wed, Apr 1, 2015 at 1:10 PM, Kumar Suraj wrote: > Hi Richard.. this wont work for me due to following reason. > > If a separate thread

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

2015-02-12 Thread Doug Currie
On Thu, Feb 12, 2015 at 1:35 PM, R.Smith wrote: > > Now one could argue the warning should not be issued for it, or some > warnings are fine as information. Personally I prefer zero unneeded > warnings/clutter but that's just my pedantism. > My pedantism is to prefer the

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

2015-02-12 Thread Doug Currie
Well, if TERM_VNULL is 0, then the code is truly unreachable, so I wouldn't call it a compiler bug. e On Thu, Feb 12, 2015 at 9:26 AM, Richard Hipp wrote: > Dan is right. I think I'd calling this a clang bug. > On Feb 12, 2015 9:06 AM, "Dan Kennedy"

Re: [sqlite] ordinary CTE containing sum()

2015-02-09 Thread Doug Currie
Thank you, Richard. It works for me now. e On Mon, Feb 9, 2015 at 1:30 PM, Richard Hipp <d...@sqlite.org> wrote: > On 2/7/15, Doug Currie <doug.cur...@gmail.com> wrote: > > In response to this SO question: > > > > > http://stackoverflow.com/questions

Re: [sqlite] ordinary CTE containing sum()

2015-02-09 Thread Doug Currie
For those interested in the initial "misuse of aggregate" issue of this thread, there is now a ticket: http://www.sqlite.org/src/tktview?name=2f7170d73b e On Mon, Feb 9, 2015 at 9:19 AM, Keith Medcalf wrote: > > Not exactly since aggregates are implemented as functions.

Re: [sqlite] ordinary CTE containing sum()

2015-02-08 Thread Doug Currie
> > > In response to this SO question: > > > > > http://stackoverflow.com/questions/28377210/how-to-retrieve-rank-based-on-total-mark-in-sqlite-table > > > > I tried to formulate a query without temp tables using an ordinary > > CTE, but received an error "misuse of aggregate: sum()". > tonypdmtr

[sqlite] ordinary CTE containing sum()

2015-02-07 Thread Doug Currie
In response to this SO question: http://stackoverflow.com/questions/28377210/how-to-retrieve-rank-based-on-total-mark-in-sqlite-table I tried to formulate a query without temp tables using an ordinary CTE, but received an error "misuse of aggregate: sum()". This works: sqlite> with tt (S_id,

Re: [sqlite] decoding a bitmask

2014-10-13 Thread Doug Currie
> > The query is on a visits table from a google chrome history database. The > query seems to work OK if a single bit is set, but fails (a blank string is > returned) when multiple bits are set. Any ideas why? > It's because none of the WHEN 0x... cases, except 0xC0..., have multiple bits set.

Re: [sqlite] Hexadecimal integer literals

2014-07-23 Thread Doug Currie
> > > Here's an analogy: a sequence of decimal digits is unsigned; it only > > becomes negative when you put a "-" in front of it. > > > > Why shouldn't hex work the same way? (to eliminate the discombobulating > > segment) > > > > Because then you would not be able to write (in hex) a 64-bit

Re: [sqlite] Hexadecimal integer literals

2014-07-23 Thread Doug Currie
> Why are hex literals interpreted as signed at all? You could simply > > consider all hex literals as unsigned values. If you need a negative > value, > > prefix it with the - operator, e.g., -0x77. > > > > With this approach (a) there is no discombobulating segment, (b) all 64 > bit > >

Re: [sqlite] Hexadecimal integer literals

2014-07-23 Thread Doug Currie
> There is this range of negative > values smack in the middle of an otherwise uniformly increasing sequence of > positive numbers. That negative range seems discombobulating. Why are hex literals interpreted as signed at all? You could simply consider all hex literals as unsigned values. If

Re: [sqlite] Concrete example of corruption

2013-12-05 Thread Doug Currie
On Dec 5, 2013, at 8:55 PM, Warren Young wrote: > On 12/5/2013 17:00, Scott Robison wrote: >> Might there be a way to implement a custom VFS for Mac to deal with this? > > Wouldn't it be a lot simpler to just put the DB file into a Mac package (i.e. > directory) so the

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-24 Thread Doug Currie
On Nov 24, 2013, at 6:47 AM, Alek Paunov wrote: > > BTW, I see the term "deterministic" in the SQL99 BNFs: > … > but different in PostgreSQL ("immutable", "stable", etc): There is value in compatibility, but those adjectives are awful. In computer science we have

Re: [sqlite] Mystery why SQLite will not work until System.Data.SQLite has been installed

2013-10-23 Thread Doug Currie
Paul Bainter wrote: > > > > Not sure what happened to this post previously, so I guess I'll try it > > again with some additional information > GMail considered these messages spam for some reason. Check your spam folder. e ___ sqlite-users mailing

Re: [sqlite] Hints for the query planner

2013-09-11 Thread Doug Currie
On Sep 10, 2013, at 6:23 PM, Scott Robison wrote: > I think I prefer something along the lines of "unlikely" or "likely". The > problem with a term like "selective" (at least in my brain) is that it > doesn't imply (for the single argument version) in what way it is

Re: [sqlite] [Bug] sqlite3_finalize() *DOES NOT* return most recent evaluation error code

2013-08-21 Thread Doug Currie
> I'm unable to reproduce the problem using C. Maybe it is in lsqlite3. Yes, lsqlite3 still uses the old sqlite3_prepare() API to maintain compatibility with some legacy systems. It is long past time that it should have changed to use sqlite3_prepare_v2(). Running Richard's example with

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-07 Thread Doug Currie
On Mar 7, 2013, at 11:07 AM, Ryan Johnson wrote: > > That does leave the question of what to do with cast ('1.0' as integer), > though. Without the prefix-based matching that would now return NULL rather > than 1, even though cast(1.0 as integer) would still

Re: [sqlite] Mac development question

2012-10-23 Thread Doug Currie
On Oct 23, 2012, at 4:58 PM, Igor Korot wrote: > 1. I know on Mac I need to build an application bundle. Where do I > store the .db file relative to the bundle? > Inside it? Home directory? Somewhere on the hard drive? What is the > usual place for it? If the database is

Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-06 Thread Doug Currie
On Aug 6, 2012, at 4:51 PM, Simon Slavin <slav...@bigfraud.org> wrote: > On 6 Aug 2012, at 7:48pm, Doug Currie <doug.cur...@gmail.com> wrote: > >> ~ e$ /usr/local/bin/sqlite3 :memory: 'SELECT sqlite_source_id()' >> 2012-05-14 01:41:23 8654aa9540fe9fd210899d8

Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-06 Thread Doug Currie
On Aug 6, 2012, at 8:26 AM, Simon Slavin wrote: > So either Apple has made a change between versions, or we have different > paths. I use fully qualified pathnames here: ~ e$ /usr/bin/sqlite3 :memory: 'SELECT sqlite_source_id()' 2012-04-03 19:43:07

Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Doug Currie
On Aug 3, 2012, at 3:32 PM, Tobias Giesen wrote: > Apparently Apple prevents starting other versions of it and redirects > everything to > their current version in /usr/bin. On ML here I can launch my version in /user/local/bin just fine. e$ which sqlite3

Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Doug Currie
On Aug 3, 2012, at 2:33 PM, Dan Kennedy wrote: > There was a problem similar to your description at one point, but > it should have been fixed before the 3.7.12 release. What do you > get from the shell command "SELECT sqlite_source_id();" on > Mountain Lion? e$

[sqlite] leap seconds

2012-07-13 Thread Doug Currie
The SQLite3 date & time functions are designed assuming > […] that every day is exactly 86400 seconds in duration. Before I start implementing TAI (or GPS time) to/from UTC translator plugin, has anyone already done this? Why? In a device that logs data with sub-second resolution, in my case a

Re: [sqlite] how to build sqlite4 (four)?

2012-06-28 Thread Doug Currie
On Jun 28, 2012, at 4:05 PM, Nico Williams wrote: > It's also possibly a good idea to just not have autoincrement. Let > the application implement it, no? After all, it can, including via > triggers. Or with PostgreSQL-style sequences

Re: [sqlite] VERY weird rounding error

2012-06-17 Thread Doug Currie
On Jun 17, 2012, at 12:23 PM, Keith Medcalf wrote: > SQLITE_SIGNIFICANT_DIGITS defaults to 14, but you can override it. No matter > what is requested, the maximum number of significant digits is limited to the > specification, and rounding is applied to the remaining bits of the >

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Doug Currie
On Mar 27, 2012, at 3:46 PM, Larry Brasfield wrote: > A DBMS is a good way to keep your raw data. But I highly doubt that a > majority of your analysis algorithms are going to be expressible in SQL > without going way beyond the intended purpose of the language. You will > either find

Re: [sqlite] SQLite

2011-11-10 Thread Doug Currie
On Nov 9, 2011, at 11:39 PM, Bhautik Kothadia wrote: > Is there any Operating System Required for that? See: http://www.sqlite.org/custombuild.html especially section 5.0 Porting SQLite To A New Operating System > If not then How much Memory is required? See:

Re: [sqlite] SQLite

2011-11-09 Thread Doug Currie
The PIC32MX664F064L has 64 KiB Program Memory Size 32 KiB RAM SQLite as it presently stands will not fit within these constraints. e On Nov 9, 2011, at 7:47 AM, Parthiv Shah wrote: > Respected Sir, > > We want to use DB SQLite in our product. > > We are using PIC32MX664F064L

Re: [sqlite] triggers : NEW keyword with multiple tables

2011-10-25 Thread Doug Currie
On Oct 25, 2011, at 10:59 AM, Sébastien Escudier wrote: > CREATE TRIGGER my_trigger INSTEAD OF INSERT ON my_view > BEGIN > INSERT INTO table1(type) VALUES(NEW.table1.type); > INSERT INTO table2(type) VALUES(NEW.table2.type); > END; > > ... > > Why this syntax does not work anymore ? You

Re: [sqlite] Using modifiers in julianday function

2011-10-24 Thread Doug Currie
On Oct 24, 2011, at 11:07 AM, Dilip Ranganathan wrote: > But as you all know, this doesn't work: > > select datetime(time) from table where time >= > julianday(datetime(max(time)),'-2 hour','localtime') order by time desc Try replacing datetime(max(time)) with (select datetime(max(time)) from

Re: [sqlite] MC/DC coverage explained wrong in the home page?

2011-09-23 Thread Doug Currie
On Sep 23, 2011, at 9:17 PM, Richard Hipp wrote: > paper above completely ignores this issue. It is as if the authors had > never heard of short-circuit evaluation. Or, perhaps they are familiar with > the problem but could not reach agreement on its solution so simply didn't > bring it up.

Re: [sqlite] SQLite + unicode

2011-08-10 Thread Doug Currie
On Aug 10, 2011, at 12:39 PM, NOCaut wrote: > I work in VS2008 c++ > i create data base my.db and wont use U N I C O D E function from this DLL > i find class or unit for connect to my base from VS2008 > http://sqlite.org/download.html - this link help me? > > you understand me? No, but

Re: [sqlite] c-api

2011-07-27 Thread Doug Currie
On Jul 27, 2011, at 9:22 AM, Baruch Burstein wrote: > Is there an easier way to get a single value (for instance "select > last_insert_rowid();" ) then prepare -> step -> column -> finalize? http://www.sqlite.org/capi3ref.html#sqlite3_last_insert_rowid e

Re: [sqlite] OSX path

2011-06-17 Thread Doug Currie
On Jun 17, 2011, at 2:56 PM, john darnell wrote: > I am attempting to open an SQLite database on the Mac (OSX Snow Leopard) and > am getting an error. This is the code I am using: > > char DBEnginePath[1000]; > > strcpy(DBEnginePath, "Macintosh HD:Applications:Adobe InDesign >

Re: [sqlite] [BUG] Silent change in intergeral overflow handling in 3.7.6

2011-05-26 Thread Doug Currie
On May 26, 2011, at 2:54 AM, Jan Hudec wrote: > Gotcha! No, it's not. -1-x is equivalent, but -x-1 is not: > >sqlite> select -1-(1<<63), -(1<<63)-1; >9223372036854775807|9.22337203685478e+18 > > Besides my point was not that it's not possible, but that it would > be more readable with

Re: [sqlite] SQLite Explorer (singular) is missing the STDEV function (standard deviation)

2011-03-31 Thread Doug Currie
On Mar 31, 2011, at 2:27 PM, Mike Rychener wrote: > I have tried the latest Explorer and it gets a syntax error on STDEV. > However, that function works in Eclipse just fine, to take the standard > deviation of a column (like min, max, avg). Is there a workaround or > other fix available?

Re: [sqlite] Backup-restore behaviour

2010-12-07 Thread Doug Currie
On Dec 7, 2010, at 10:49 AM, Csom Gyula wrote: > It clarified the situation, that is backup-restore seems to be the best > choice:) Just one more question. As you put backup-restore is based upon data > pages (that could be binary a format I guess) not on plain SQL/data records. > After all:

Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-29 Thread Doug Currie
On Nov 29, 2010, at 9:37 AM, Rick Regan wrote: > "For IEEE 754 double-precision numbers and 64-bit integers roughly > 99.4% of all numbers can be processed efficiently. The remaining 0.6% are > rejected and need to be printed by a slower complete algorithm." > > Hmmm. What's involved in the

Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Doug Currie
On Nov 28, 2010, at 6:19 PM, Rick Regan wrote: > On Sun, Nov 28, 2010 at 5:52 PM, Doug Currie <doug.cur...@gmail.com> wrote: > >> >> There is a new publication on this subject that may be of interest to those >> looking at providing solutions: >> >

Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Doug Currie
On Nov 28, 2010, at 5:37 PM, Rick Regan wrote: > On Sun, Nov 28, 2010 at 4:01 PM, Doug Currie <doug.cur...@gmail.com> wrote: > >> On Nov 28, 2010, at 11:18 AM, Rick Regan wrote: >> >>> Michael, >>> Thanks for the very thorough analysis. >&

Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-28 Thread Doug Currie
On Nov 28, 2010, at 11:18 AM, Rick Regan wrote: > Michael, > Thanks for the very thorough analysis. This is a difficult problem; fortunately it was solved 20 years ago... http://www.mail-archive.com/sqlite-users@sqlite.org/msg09529.html e ___

Re: [sqlite] Why the deadlock?

2010-08-24 Thread Doug Currie
On Aug 24, 2010, at 10:57 AM, Nikolaus Rath wrote: > Nikolaus Rath writes: >> Still no one able to clarify the issues raised in this thread? >> >> Let me try to summarize what I still don't understand: >> >> - Will SQLite acquire and release an EXCLUSIVE

Re: [sqlite] playing with triggers

2010-08-19 Thread Doug Currie
On Aug 19, 2010, at 4:00 PM, David Bicking wrote: > I haven't tried RAISE(ROLLBACK... as that seems to severe. > RAISE(ABORT... removes the initial insert to Table1, which I want to avoid. > RAISE(FAIL.. on lets say the fourth record inserted in to Table2, would leave > the first three there,

Re: [sqlite] What languages can include SQLite statically?

2010-06-01 Thread Doug Currie
On Jun 1, 2010, at 2:24 PM, Gilles Ganault wrote: > Actually, it's a Blackfin processor, and since it's an embedded > environment, RAM and storage (NAND) are an issue. You may find eLua interesting. http://www.eluaproject.net/ The supported platforms are heavily ARM based, but in the same

Re: [sqlite] sqlite on mac os x 64 bits

2010-05-18 Thread Doug Currie
On May 18, 2010, at 4:14 AM, Sylvain Pointeau wrote: > but is it 64 bits? or do I have to add a special option? Last time I built a Universal Binary sqlite3 on OS X (March 2010 3.6.22) I had to CFLAGS='-arch i686 -arch x86_64' LDFLAGS='-arch i686 -arch x86_64' ./configure

Re: [sqlite] round problem?

2010-02-15 Thread Doug Currie
On Feb 15, 2010, at 1:43 PM, Roger Binns wrote: > Shane Harrelson wrote: >> I'm looking at how this can be improved. > > It seems that everyone else is converging on using David Gay's dtoa.c We've been "converging" for a few years!

Re: [sqlite] In Memory Usage

2010-01-04 Thread Doug Currie
On Jan 4, 2010, at 6:35 AM, sasikuma...@tcs.com wrote: > I'm using SQLite DB version 3.6.12. I recently read about the feature of > In-Memory Database and tried to implement it. I was able to create a new > DB connection in memory, able to create a table and insert some set of > records into

Re: [sqlite] Unique index on REAL values and equality check

2009-12-13 Thread Doug Currie
On Dec 13, 2009, at 3:16 PM, Alexey Pechnikov wrote: > As we can see, the unique index can check equlity of REAL values > but the "=" operator can not. it's fantastic I think :-) The problem is not the "=" operator... sqlite> create table test (save_date REAL unique); sqlite> insert into test

Re: [sqlite] SQLite on PocketBook

2009-11-05 Thread Doug Currie
On Nov 5, 2009, at 5:15 PM, Beau Wilkinson wrote: > I really think this warrants further discussion. Perhaps the correct > answer (that ARMs implement a non-standard FP type which is > incompatible with Sqlite) is already out there, but I think the > issues I raised with that answer should

Re: [sqlite] feature proposal - strong but dynamic typing

2009-10-30 Thread Doug Currie
On Oct 30, 2009, at 10:14 AM, P Kishor wrote: > Actually, there can be one bad effect of Darren's suggestion, now that > I think of it, and that would be for those who don't care for strong > typing. They will end up getting strong typing for all non-UNIVERSAL > columns whether they like it or

Re: [sqlite] Huge numbers of savepoints.

2009-08-23 Thread Doug Currie
On Aug 23, 2009, at 6:46 AM, Chris Dew wrote: > Note: this is not for production code, just an experiment in keeping a > history of application 'state', allowing current state to be > recalculated if an historic input is received 'late'. See >

Re: [sqlite] What is a Relation?

2009-07-27 Thread Doug Currie
On Jul 27, 2009, at 10:33 AM, CityDev wrote: > It's true that Codd and Date used the term 'relational' (They > championed the > N-ary Relational Model - others were around at the same time) but > it's not > easy to track the origin of the term in mathematics.

Re: [sqlite] SQLite: Porting to another Operating system.

2009-07-24 Thread Doug Currie
On Jul 24, 2009, at 8:44 AM, D. Richard Hipp wrote: > SQLite database files are cross-platform. All you have to do is copy > the file to the new machine. There is no separate "external format". > The same database file format work on all platforms. Just make sure that if you are moving to a

Re: [sqlite] sqlite3.OperationalError: unable to open database file

2009-07-07 Thread Doug Currie
On Jul 7, 2009, at 4:36 PM, nixonron wrote: > conn = sqlite3.connect('c:\Ujimadata\aid.sqlite') Perhaps you meant conn = sqlite3.connect('c:\\Ujimadata\\aid.sqlite') or conn = sqlite3.connect('c:/Ujimadata/aid.sqlite') e ___ sqlite-users mailing

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Doug Currie
On Jun 12, 2009, at 3:46 PM, Allen Fowler wrote: > sqlite> > select *, min((strftime('%s', end) - strftime('%s', start))) as > length > from > ...> events where > ...> start < datetime('now', '+1 day','start of day', > '+9 hours','+30 minutes') > ...> and end > datetime('now', '+1

Re: [sqlite] error in documentation of SELECT?

2009-05-19 Thread Doug Currie
On May 19, 2009, at 10:05 AM, Jean-Denis Muys wrote: > On 5/19/09 2:44 PM, "Igor Tandetnik" wrote: >> >> Wikipedia gives a definition different from yours, for what it's >> worth: >> >> http://en.wikipedia.org/wiki/Remainder#The_case_of_general_integers > > Also to

Re: [sqlite] How make atomic? Was: Sqlite as a FIFO buffer?

2009-05-18 Thread Doug Currie
On May 18, 2009, at 5:32 PM, Allen Fowler wrote: >>> The simple solution would just create a race condition... i think: >>> >>> 1) INSERT INTO status_table FROM SELECT oldest task in queue >>> 2) DELETE oldest task in queue >>> >>> Right? >> >> It might work fine if you wrap it in an exclusive

Re: [sqlite] CURRENT_TIMESTAMP precision

2009-05-15 Thread Doug Currie
On May 15, 2009, at 9:07 AM, Sam Carleton wrote: > I would like CURRENT_TIMESTAMP to be more accurate than just one > second, any suggestions on how I might do that once? My solution is > all a C/C++ interface, so all features are open to me. Option 1 - use: julianday('now') instead of

Re: [sqlite] Sporadic freezes of sqlite

2009-04-22 Thread Doug Currie
On Apr 22, 2009, at 4:38 PM, Pavel Ivanov wrote: > I've tried to set pragma synchronous = on (it's off by default for > me), but it makes application to work 5 times slower which is not > acceptable for me. I would be happy if there was some solution in > between that, i.e. for example just a

Re: [sqlite] Query Doesn't Find Record

2009-03-11 Thread Doug Currie
On Mar 12, 2009, at 12:08 AM, jonwood wrote: > Doug Currie-2 wrote: >> >> Note the '/'s >> > > What does this mean? What does DATE('2009-1-1') or DATE('2009/1/1') > return? > Does DATE() simply have no effect whatsoever? Sorry to be cryptic. sqlite> select

Re: [sqlite] Query Doesn't Find Record

2009-03-11 Thread Doug Currie
On Mar 12, 2009, at 12:01 AM, jonwood wrote: > PaymentDate=2009/01/05 Note the '/'s > And then I ran the following query: > > SELECT * FROM Payments WHERE FK_CustomerID=5 AND DATE(PaymentDate) >= > DATE('2009-01-01') AND DATE(PaymentDate) <= DATE('2009-03-11') Note the '-'s. '2009/' >

Re: [sqlite] sqlite for embedded devices

2008-11-26 Thread Doug Currie
On Nov 25, 2008, at 1:44 PM, Igor Augusto Guzzo wrote: > I get an ARM based embedded system (AT91SAM9260 - ATMEL), linux based, > with uclibc library and my code, developed in C with the sqlite3 > library, runs fine only in my host linux (Fedora). > > Firstly, I compiled the code on Makefile

Re: [sqlite] Performance improvement In Sqlite 3.6.4 version

2008-11-18 Thread Doug Currie
On Nov 18, 2008, at 5:10 AM, Roshan Sullad wrote: > [...] > I have another Visual studio test application where I am using this > Sqlite3.dll functionality, I have linked statically to Sqlite3.dll by > including *sqlite3.c,sqlite3.h,sqlite3ext.h* , files in to my test > application project. And

Re: [sqlite] sqlite insert and delete statements not succeed

2008-11-13 Thread Doug Currie
On Nov 12, 2008, at 10:31 PM, henry wrote: > my app, I opened a database handler, insert some records, delete some > records, then closed the database handler. The problem is the next > time > when I connect the Sqlite, the actions I did last time has all gone > away, it did not take any

Re: [sqlite] [C++] Import sqlite3.dll and/or sqlite database as resource in project?

2008-08-10 Thread Doug Currie
On Aug 10, 2008, at 2:12 PM, CAVALO SCHMIDT wrote: > salutations, using VC++ in WinXP. > > I would like to know if it's possible to import and use the > sqlite3.dll file and/or the sqlite database file as a resource in a > C++ project, so that it will be integrated to the final Win32 >

Re: [sqlite] compiling C program to use the shared library

2008-02-24 Thread Doug Currie
he reason an import library isn't included is because you need a > different one for each compiler you use to link. Right, and with gcc on Windows (mingw/msys or cygwin), you don't need an import library at all; gcc will link against the DLL itself. e

Re: [sqlite] Mailing List Changes

2008-02-04 Thread Doug Currie
> This mailing-list business is becoming a royal pain in the derriere. > Every other mailing list behaves differently... some default to the > list, others to the OP. Why can't we all get along. > Please set the list so default reply is to the list. http://www.unicom.com

Re: [sqlite] SQLite character comparisons

2008-01-20 Thread Doug Currie
e pad character is a > . So, using this terminology, the SQLite default collating sequence has the NO PAD attribute, and the pad character is NUL. Jeff, can you solve your problem with a custom collating sequence? e -- Doug Currie Londonderry, NH, USA

Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-05 Thread Doug Currie
hereas gcc uses 96 bits (64 bit mantissa). Note that realvalue above is declared as LONGDOUBLE_TYPE (long double). http://msdn2.microsoft.com/en-us/library/9c3yd98k(VS.80).aspx http://msdn2.microsoft.com/en-us/l

Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-05 Thread Doug Currie
On Wednesday, September 05, 2007 Arjen Markus wrote: > Doug Currie wrote: >>I suspect the bug is in the functions that convert between string and >>double; that's why I keep harping on Steele and White's (and >>Clinger's) PLDI 1990 papers. What I don't know is

Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-04 Thread Doug Currie
g and double; that's why I keep harping on Steele and White's (and Clinger's) PLDI 1990 papers. What I don't know is why this bug appears in the binary from sqlite.org but not in the version I build myself with gcc 3.4.5 from SQLite version 3.4.2 source. e -- D

Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-03 Thread Doug Currie
ons, and so results between Microsoft Visual C++ compiled and gcc compiled versions of sqlite3 are bound to produce different results. Why my gcc 3.4.5 compiled sqlite3.exe and the one from the sqlite.org downloads page produce different results is still a mystery to me. e -- Doug Currie L

Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-03 Thread Doug Currie
gcc, but I don't know what version. However, if I compile from sources, I get C:\Dev\sqlite\sqlite-3.4.2\bld>.\sqlite3 SQLite version 3.4.2 Enter ".help" for instructions sqlite> select round(98926650.5, 1); 98926650.5 I am using: $ gc

Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-03 Thread Doug Currie
lest number of digits necessary to reconstruct the number. This will be the number of digits that Serena expects. e -- Doug Currie Londonderry, NH, USA - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] Re: select round(98926650.50001, 1) ?

2007-09-03 Thread Doug Currie
eless, there are ways to print floating point numbers readably. http://portal.acm.org/citation.cfm?id=93559 e -- Doug Currie Londonderry, NH, USA - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] Concurrency

2007-06-01 Thread Doug Currie
ts. Of course, if you expect there to be intervals when there are no waiting threads, and you can afford to wait for that interval for a synchronization point, and you don't care the order in which the inserts are performed, the Automatic Reset event might work. e > On 6/1/07, Doug Currie

Re: [sqlite] Concurrency

2007-06-01 Thread Doug Currie
when multiple threads are waiting on the event; they all wake up and compete for the resource again. For better solutions, see: http://world.std.com/~jmhart/batons.htm e -- Doug Currie Londonderry, NH, USA - To unsubscribe,

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-04 Thread Doug Currie
were first published in 1974 by Don Chamberlin and Ray Boyce at the ACM–SIGFIDET Workshop on Data Description, whereas "ess cue ell" is used for subsequent standardized versions of the language. e -- Doug Currie Londonderry, NH, USA --

Re: [sqlite] Does julianday work according to the manual?

2007-01-31 Thread Doug Currie
21388.0 sqlite> Select julianday('0001-11-24 12:00:00'); 1721753.0 There is no year 0. The calendar goes from -1 BCE to 1 CE. -11-24 is 1 BCE. So, if you want November 24, 4714 B.C. you need to say sqlite> Select julianday('-4713-11-24 12:00:00'); 0.0 e

Re: [sqlite] MSWindows SQLite Compilation

2007-01-10 Thread Doug Currie
is hardly ever a reason to do this since gcc will link against the DLL directly. e -- Doug Currie Londonderry, NH, USA - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] Re: Terminating long query in C ?

2006-10-10 Thread Doug Currie
have escaped the notice of users on non-posix systems. >> >> One can register a Ctrl-C handler on Windows with SetConsoleCtrlHandler. >> But the handler is invoked on a background thread created by the system >> specifically for this purpose, so sqlite3_interrupt couldn't be used

Re: [sqlite] Query returns all rows

2006-09-25 Thread Doug Currie
Monday, September 25, 2006, 1:46:12 PM, David Champagne wrote: > and then I execute a query > SELECT * FROM License WHERE FORM = "form"; > I get all rows returned Try: SELECT * FROM License WHERE FORM = 'form'; e -- Doug Cur

Re: [sqlite] SQLite Vs VistaDB - Comparison ???

2006-06-16 Thread Doug Currie
p=BlueSky the shadow pager. > Note, I'm not suggesting that you should implement anything like this > in SQLite... Me neither. ;-) e -- Doug Currie Londonderry, NH

Re: [sqlite] SQLite :memory: performance difference between v2 and v3?

2006-05-04 Thread Doug Currie
Thursday, May 4, 2006, 1:27:49 PM, Dennis Cote wrote: > More mysteries. To investigate this low insert performance under WinXP I > wrote a simple test program that loops writing one character to a file > and then flushing the file. The strange thing is that it seems to > alternate between two

Re: [sqlite] [SOLVED] Re: [sqlite] LIKE and GLOB bug with numbers?

2006-03-28 Thread Doug Currie
improved. > I couldn't agree more with you. > Thanks for the help! > Regards, > -- Tito -- Doug Currie Londonderry, NH

Re: [sqlite] Join on same table and performance.

2006-03-24 Thread Doug Currie
e); > create index source_idx on Media (key,source); > create index key_source_val_idx on Media (key,source,value); I wonder what effect create table Media (id INTEGER PRIMARY KEY, key, value, source integer); would have on your query time. This would use the already built-in BTree index. e --

[sqlite] 3.3.4 build with MinGW/MSYS

2006-02-19 Thread Doug Currie
A brief report on building sqlite-3.3.4 with MinGW/MSYS and tcl84 on WinXP... 1. After configure, a small edit was necessary to the Makefile; for some reason libtool doesn't put .lo objects into .libs subdirectory anymore; there was also an issue reported on the mailing list with stripping the

  1   2   >