Re: [sqlite] Resolving Database locking issues in a multi-user environment

2012-10-19 Thread Nick Shaw
atabase at the same time, resulting in database corruption*." Seems pretty clear to me from that statement that SqLite would not suite your system's requirements as a central database. Nick. On Fri, Oct 19, 2012 at 4:21 PM, Nick Shaw wrote: > Richard Hipp wrote: > > Ben Mor

Re: [sqlite] Resolving Database locking issues in a multi-user environment

2012-10-19 Thread Nick Shaw
Richard Hipp wrote: > Ben Morris wrote: >> If anyone could share their honest opinions of both my suggested >> approach, and my colleague's, I would be very grateful. > > [snip] > Using a separate SQLite database on each client to serve as a local cache of > the master database and then > period

Re: [sqlite] Unicode problem when setting PRAGMA journal_mode

2012-04-11 Thread Nick Shaw
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Nick Shaw Sent: 11 April 2012 16:29 To: General Discussion of SQLite Database Subject: Re: [sqlite] Unicode problem when setting PRAGMA journal_mode -Original Message

Re: [sqlite] Unicode problem when setting PRAGMA journal_mode

2012-04-11 Thread Nick Shaw
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Kennedy Sent: 11 April 2012 16:07 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Unicode problem when setting PRAGMA journal_mode > After sqlite3_close() returns SQLITE_BU

Re: [sqlite] Unicode problem when setting PRAGMA journal_mode

2012-04-11 Thread Nick Shaw
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Kennedy Sent: 11 April 2012 16:07 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Unicode problem when setting PRAGMA journal_mode > > I'll try your suggestion of setting i

Re: [sqlite] Unicode problem when setting PRAGMA journal_mode

2012-04-11 Thread Nick Shaw
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: 10 April 2012 19:04 To: General Discussion of SQLite Database Subject: Re: [sqlite] Unicode problem when setting PRAGMA journal_mode >> Realised I made a typo

Re: [sqlite] Unicode problem when setting PRAGMA journal_mode

2012-04-10 Thread Nick Shaw
Realised I made a typo below: should have said "PRAGMA journal_mode = DELETE" (though setting it to WAL or OFF causes the same problem). -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Nick Shaw Sent: 05 April 201

[sqlite] Unicode problem when setting PRAGMA journal_mode

2012-04-05 Thread Nick Shaw
Hi all, Our windows application uses sqlite, and we've had no problems with it in our existing builds, which use the multibyte character set. We are now converting our codebase to Unicode. SqLite is quite happily running with our Unicode builds, creating SqLite databases in UTF-16LE encoding.

Re: [sqlite] Visual Studio 2008 Express and sqlite3.c

2012-03-30 Thread Nick Shaw
-Original Message- > I am trying to compile the latest sqlite 3.7.11 amalgamation C file within a > Visual Studio 2008 Express C++ project. > sqlite3.c is correctly set as to be compiled as C code but I am unable to > find out a way to fix some compilation errors: > > Compiling... > sqlit

Re: [sqlite] storing and comparing dates in sqlite

2012-01-24 Thread Nick Shaw
It's your choice, really. You could store it as TEXT, in some standardised format (e.g. XML dateTime format: -mm-ddThh:mm:ss. plus a timezone offset if you wanted) or your own format, and query it back as text, or you could store it in UNIX integer time (seconds since unix epoch (01/01/

Re: [sqlite] Making data and tables persistent

2011-06-03 Thread Nick Shaw
Darren Duncan wrote: > >> I am using sqlite3 primarily from c++, everything is working fine, > >> except when I switch off my computer I loose all data, is there any > >> setting I need to do to make the data and table object persistent in the .db file? > > > > Are you correctly closing your con

Re: [sqlite] Biggest number in an INTEGER field

2011-06-01 Thread Nick Shaw
> Guys, an an SQLite3 INTEGER field what is the maximum number that fits in an INTEGER PRIMARY KEY field? According to http://www.sqlite.org/faq.html#q1, it is 9223372036854775807. Thanks, Nick. ___ sqlite-users mailing list sqlite-users@sqlite.org http

Re: [sqlite] Sqlite Files

2011-05-23 Thread Nick Shaw
There's always the SQLite manager for FireFox add-on: http://code.google.com/p/sqlite-manager/. I use it quite a lot to quickly check the data inside my own sqlite databases. Has a pretty intuitive GUI. Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-

Re: [sqlite] Compiler warnings in R-Tree code under Visual StudioExpress

2011-02-18 Thread Nick Shaw
Afriza N. Arief wrote: > I tried to compile SQLite 3.7.5 with SQLITE_ENABLE_RTREE=1 and got the following warnings: > > sqlite3.c(120736): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data > sqlite3.c(120749): warning C4244: '+=' : conversion from 'double' to 'float',

Re: [sqlite] sqlite3_open on non-DB files / corrupt DBs - Found word(s) list error in the Text body

2010-11-25 Thread Nick Shaw
Tito Ciuro wrote: > On 25 Nov 2010, at 12:51, Igor Tandetnik wrote: > > Run "PRAGMA integrity_check" right after opening. > > That could be a potentially slow operation if the database is valid and contains lots of records. > Wouldn't be better to issue a SELECT statement and let SQLite come back

Re: [sqlite] sqlite3_open on non-DB files / corrupt DBs

2010-11-25 Thread Nick Shaw
Igor Tandetnik wrote: > > > Is there a reason that sqlite3_open() will happily "open" a non-sqlite > > file, returning SQLITE_OK, instead of returning SQLITE_NOTADB, which > > would seem a more obvious return value? > > SQLite doesn't actually touch the file until the first "substantive" stateme

[sqlite] sqlite3_open on non-DB files / corrupt DBs

2010-11-25 Thread Nick Shaw
Hi all, Is there a reason that sqlite3_open() will happily "open" a non-sqlite file, returning SQLITE_OK, instead of returning SQLITE_NOTADB, which would seem a more obvious return value? It will also happily open a sqlite database that it will later say is corrupt when I try to query some dat

Re: [sqlite] DB file locked when no other process using it - Found word(s) list error in the Text body

2010-09-15 Thread Nick Shaw
I've seen this kind of issue before - after closing the sqlite3 database, I can't delete the file (I would want to do this if I opened an sqlite3 database and found it to be corrupt). As sqlite's connection handle has closed, I assume sqlite should no longer have any handles open to the database;

Re: [sqlite] Are triggers the best way to store the modification time?

2010-09-07 Thread Nick Shaw
Oliver Schneider wrote: > I'm having a table of file names along with hashes and so on. In order > to make sure that we keep a record, I had put a trigger on UPDATE and > INSERT which would set the column 'modified' (REAL, Julian day) to the > time of the change. However, this slows down any INSERT

Re: [sqlite] SqLite 3.7.0 amalgamation build warnings

2010-07-15 Thread Nick Shaw
> Looks like this warning can be safely ignored and internet even has > quite a few suggestions on its suppression. Here's what I found: > http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/195e7065- > b429-4324-9f38-35558867cfbd > http://www.tech- > archive.net/Archive/VC/microsoft.pub

Re: [sqlite] SqLite 3.7.0 amalgamation build warnings

2010-07-07 Thread Nick Shaw
Lite Database > Subject: Re: [sqlite] SqLite 3.7.0 amalgamation build warnings > > Nick Shaw wrote: > > > Realised I also fixed this warning before posting too: > > You may not be getting a lot of responses on this because the SQLite > devs have a philosophy that, fo

Re: [sqlite] SqLite 3.7.0 amalgamation build warnings

2010-07-07 Thread Nick Shaw
boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Nick Shaw > Sent: 07 July 2010 14:47 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] SqLite 3.7.0 amalgamation build warnings > > Forgot to say: I've got these lines added at the top o

Re: [sqlite] SqLite 3.7.0 amalgamation build warnings

2010-07-07 Thread Nick Shaw
Nick. > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Nick Shaw > Sent: 07 July 2010 13:43 > To: sqlite-users@sqlite.org > Subject: [sqlite] SqLite 3.7.0 amalgamation build warnings > > Hi, > >

[sqlite] SqLite 3.7.0 amalgamation build warnings

2010-07-07 Thread Nick Shaw
Hi, I wanted to test the upcoming 3.7.0 build of sqlite to assist in the 'beta testing', however I'm getting the following build warnings which did not appear when compiling 3.6.x amalgamations. Please let me know if they are considered safe to ignore: (building in Visual Studio 2008 as pa

Re: [sqlite] columnb = upper(columna)

2010-06-23 Thread Nick Shaw
>> Ian Hardingham wrote: >>> I'm just getting around to this. Can I do: >>> >>> ALTER TABLE userTable ADD upperName = upper(name) TEXT >>> >>> Will this retroactively and for all future inserts work? >> >> This is not a valid syntax, so it won't work - neither retroactively, in the present, no

Re: [sqlite] database corruption problem

2010-06-08 Thread Nick Shaw
Daniel Stutzbach wrote: > Are there any other known ways that the database might become corrupt? My list of possible causes would be: 1) File/Disk corruption by the OS. On Windows, this can happen if the system suffers a power loss in the middle of a write, most noticeable when you're writing a la

Re: [sqlite] File locking with BEGIN/END

2010-05-25 Thread Nick Shaw
> You need to add your records in smaller batches and sleep just a little between iterations. > > Your batches will have to be small enough to make the user response time reasonable. > > You'll find that your loop of inserting records won't take long. It's when you do the "COMMIT" that it lock

Re: [sqlite] File locking with BEGIN/END

2010-05-25 Thread Nick Shaw
> Is it possible you have a busy-handler installed? Are you using SQLite directly or via some wrapper API? Yes and no. I set a busy handler of 1 minute, but it takes longer than this and doesn't timeout, plus I tried without the busy timeout; made no difference. Thanks, Nick. ___

[sqlite] File locking with BEGIN/END

2010-05-25 Thread Nick Shaw
Hi all, I've got a database that is accessed by two processes on the same PC. When I add a large number of records to a table from one process (all records wrapped in a BEGIN DEFERRED / END so it's committed to disk all at once; and we're talking about adding 500,000 recs to a DB containing aro

Re: [sqlite] Executing SELECT and INSERT from C under Linux

2010-04-12 Thread Nick Shaw
I assume you're using the C API calls to open/close the database? If so, it's just another API call to execute some simple SQL: sqlite3_exec(). If you need something more advanced, like prepare, bind, step etc, then see the appropriate APIs for those. All listed in http://www.sqlite.org/c3ref/fu

Re: [sqlite] [newbie/VB.Net + SQLite] Reliable file hashing?

2010-03-05 Thread Nick Shaw
Small aside: Why do you select the id, name AND hash in the select? You don't appear to use them. I can't see anything specifically wrong, but try doing "SELECT COUNT(id) WHERE hash='@hash'" instead, and see if the returned count > 0 or not. You could also maybe test your routine by passing in a

Re: [sqlite] [VB.Net] Working with SQLite?

2010-02-24 Thread Nick Shaw
Subject: Re: [sqlite] [VB.Net] Working with SQLite? On Wed, 24 Feb 2010 13:17:23 -, "Nick Shaw" wrote: >You could just import the required DLL functions from sqlite3.dll? Not >very object-oriented, I admit - you'd need to write your own class >wrapper around the functions

Re: [sqlite] Fwd: Sqlite files in temp folder

2010-02-24 Thread Nick Shaw
I'd suggest Anita uses a file monitoring app (like SysInternals' DiskMon, if she's using Windows) to see what is writing those files. Then stop the app from doing it. Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of D. Ri

Re: [sqlite] [VB.Net] Working with SQLite?

2010-02-24 Thread Nick Shaw
You could just import the required DLL functions from sqlite3.dll? Not very object-oriented, I admit - you'd need to write your own class wrapper around the functions if you wanted that - but I'd think that importing the functions was the quickest method, and then you're not reliant on 3rd party i

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread Nick Shaw
What's the actual code output from your program? i.e. which sqlite3_close() is it failing on? Can you call sqlite3_errmsg() when sqlite3_open() failed to initialise the db struct? I would have thought "db" would be invalid at that point. Try setting db to NULL when declaring it, as otherwise yo

Re: [sqlite] sqlite3_prepare_v2

2009-12-24 Thread Nick Shaw
I'd suggest having your own sqlite3.dll in your own application's working folder, rather than relying on an existing version somewhere on the PC already which could be any version! If you created your own DLL, why would you then want to statically link to it (defeating a lot of the point of a *

Re: [sqlite] speed, writing spends 30ms, reading spends 2ms, still slow

2009-12-24 Thread Nick Shaw
The read/write speed will depend quite a lot on disk access speed (unless you're using an in-memory DB of course), not just the database size/complexity/query. Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of liubin li

Re: [sqlite] Vaccum with VB,NET

2009-12-24 Thread Nick Shaw
VACUUM is an SqLite SQL command, so just use it inside an sqlite3_exec() statement using "VACUUM" as the SQL string parameter. Thanks, Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Ernany Sent: 24 December 2009 01:17 T

[sqlite] Effect of VACUUM when very low on disk space

2009-12-07 Thread Nick Shaw
Hi all, I'm currently writing some code that attempts to keep an SqLite database file below a certain file size (the embedded PC it is running on has a wonderful side effect that when the disk runs out of disk space, it blue-screens Windows and you can't boot the device after that - how helpful

Re: [sqlite] Possibly a bug in SQLite?

2009-12-02 Thread Nick Shaw
To: General Discussion of SQLite Database Subject: Re: [sqlite] Possibly a bug in SQLite? On Wed, Dec 02, 2009 at 09:38:54AM -, Nick Shaw scratched on the wall: > You don't need to define the PRIMARY KEY as NOT NULL - it's implied. Yes, you do. You shouldn't, but

Re: [sqlite] Possibly a bug in SQLite?

2009-12-02 Thread Nick Shaw
You don't need to define the PRIMARY KEY as NOT NULL - it's implied. The column constraint flow diagram in the documentation in fact doesn't allow it: http://www.sqlite.org/syntaxdiagrams.html#column-constraint Maybe that's the problem? Try recreating the table without the NOT NULL constraint on

Re: [sqlite] sqlite3 bind and insert double values

2009-11-30 Thread Nick Shaw
Agreed - the difference in coordinates between the two values amounts to 3/10,000's of a second, which is about 9 millimeters. Most GPS devices can't give accuracy to more than 5 meters! It's also probably nicer storing GPS coordinates as numeric instead of text, as then you can use some useful e

Re: [sqlite] sqlite3 bind and insert double values

2009-11-30 Thread Nick Shaw
How different are they? Could this be [unavoidable] binary floating point storage limitations? Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Michael Lippautz Sent: 30 November 2009 13:50 To: sqlite-users@sqlite.org Su

Re: [sqlite] Huge Table with only one field -- efficientway to create index ?

2009-11-26 Thread Nick Shaw
As Igor says, it's most likely the way you're creating your SQL query. For example, if you're using C/C++ and you're trying to write a 64 bit number to a string using the %d flag in sprintf(), if won't work properly - you'd need to use %I64d for 64 bit numbers. 32-bit integers go up to (unsigned)

Re: [sqlite] Huge Table with only one field -- efficient way to create index ?

2009-11-26 Thread Nick Shaw
Out of interest, is all the data in the artnr field numeric? If so, why are you storing it as text and not an integer? Integer searching is much, much faster. Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Thomas Lend

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-11-26 Thread Nick Shaw
By "other process" do you mean a separate DLL or similar? You can't free memory allocated in a DLL from an application, even when that application has the DLL loaded - Windows will complain. This could be what's happening. Could you instead write the database close call within this other process

Re: [sqlite] Running out of space

2009-11-25 Thread Nick Shaw
Deleting data may not free enough space in the database file to allow new records to be added [the new records may contain more data]. You could continually delete old records until an INSERT succeeded (indicating enough space now)? Otherwise, I'd say you'll just have to monitor the hard disk spa