Re: [sqlite] Suggestion to add "locate" as a broader version of "instr"

2014-02-15 Thread big stone
+1 . A few more 'classic/simple' sql instructions would not be a bad thing : sqrt(), locate(substring, string, start), ... They are not in a sql official "normalisation", but : - '%' is not either, - avg() looks a little bit incomplete without sqrt().

[sqlite] Question about how sqlite recovers after a power loss

2014-02-15 Thread ftriboix
Hello, I would like to understand better at which moment does sqlite recovers from a previous power loss. Let's take the following scenario: - sqlite3_open() - BEGIN TRANSACTION; - INSERT INTO SomeTable VALUES ("blah", "blah", blah"); => Power loss! - sqlite3_open() What I notice, is that

[sqlite] Documentation error: sqlite3_mutex_try

2014-02-15 Thread Doug Nebeker
The documentation says that sqlite3_mutex_try will always return SQLITE_BUSY for "some systems (for example, Windows 95)". That's not quite accurate from what I see in the latest implementation of winMutexTry. It will ALWAYS return SQLITE_BUSY for any Windows usage, making the existence of

[sqlite] Windows service with SQLITE

2014-02-15 Thread tejas parekh
Hi All, We have a small issue with sqlite database. Program structure: one windows service calls two windows processes process-1 and process-2. both processes use common database db1.s3db file to store data. When windows services starts and calls two processes p-1 and p-2 none of the process is

Re: [sqlite] Question about how sqlite recovers after a power loss

2014-02-15 Thread Richard Hipp
On Fri, Feb 14, 2014 at 10:13 AM, wrote: > Hello, > > I would like to understand better at which moment does sqlite recovers > from a previous power loss. > > Let's take the following scenario: > - sqlite3_open() > - BEGIN TRANSACTION; > - INSERT INTO SomeTable VALUES

[sqlite] Get whether a column has been defined as 'unique'

2014-02-15 Thread J Trahair
Hi all I have a table in a database, one of the columns is TEXT NOT NULL UNIQUE. If I want to find out which column has been designated unique, how can I do it? I can get the DataType of each column by testing the value of objDs1.Tables(0).Columns(numColumnNumber).DataType.ToString where

Re: [sqlite] Suggestion to add "locate" as a broader version of "instr"

2014-02-15 Thread Gabor Grothendieck
On Fri, Feb 14, 2014 at 2:33 PM, Max Vlasov wrote: > Hi, > > Some time ago when there was no "instr" functions, I looked at Mysql help > pages and implemented a user function "locate" as the one that allows > searching starting a particular position in the string. With two

Re: [sqlite] Question about how sqlite recovers after a power loss

2014-02-15 Thread Fabrice Triboix
Hi Richard, All right, many thanks for that. So if I do, say, a SELECT just after opening the database, that's when the recovery will actually take place and the journal file will be replayed and deleted. Is my understanding correct? Many thanks for your help! Best regards, Fabrice

Re: [sqlite] Question about how sqlite recovers after a power loss

2014-02-15 Thread Kees Nuyt
On Sat, 15 Feb 2014 14:55:48 +, "Fabrice Triboix" wrote: > Hi Richard, > > All right, many thanks for that. So if I do, say, > a SELECT just after opening the database, that's > when the recovery will actually take place and > the journal file will be replayed and

Re: [sqlite] Question about how sqlite recovers after a power loss

2014-02-15 Thread Richard Hipp
On Sat, Feb 15, 2014 at 9:55 AM, Fabrice Triboix wrote: > Hi Richard, > > All right, many thanks for that. So if I do, say, a SELECT just after > opening the database, that's when the recovery will actually take place and > the journal file will be replayed and deleted. >

Re: [sqlite] Get whether a column has been defined as 'unique'

2014-02-15 Thread Igor Tandetnik
On 2/15/2014 8:09 AM, J Trahair wrote: [I often use the structure of a table to recreate the table as new from scratch, or to clone it into a different table, eg. I have a table called 'Customers', I want to have a table called 'Enquirers' with exactly the same structure. select sql from

Re: [sqlite] Get whether a column has been defined as 'unique'

2014-02-15 Thread J Trahair
Thank you, that's great. Jonathan On 15/02/2014 16:14, Igor Tandetnik wrote: On 2/15/2014 8:09 AM, J Trahair wrote: [I often use the structure of a table to recreate the table as new from scratch, or to clone it into a different table, eg. I have a table called 'Customers', I want to have a

Re: [sqlite] Windows service with SQLITE

2014-02-15 Thread Klaas V
Tejas Parekh wrote: "both processes use common database db1.s3db file to store data." Unfortunately SQLite does not allow more than one process to write a single file the same time. The one writing process should unlock "his" database in order to make it possible to others to make changes to 

Re: [sqlite] Windows service with SQLITE

2014-02-15 Thread Teg
Hello tejas, I'm thinking it sounds like the processing collides and you don't have retry's built into the process. Basically a race condition. The fact you can run one process and it works, and then later run a second process and it works suggests the problem is in the startup when you

Re: [sqlite] Windows service with SQLITE

2014-02-15 Thread Simon Slavin
On 15 Feb 2014, at 12:29pm, tejas parekh wrote: > When windows services starts and calls two processes p-1 and p-2 none of > the process is able to store data in the database. > But if i call only one p-1 with service then everything works well > meanwhile if i run p-2