Re: [sqlite] SUGGESTION: now as alias for strftime('%s','now')

2012-11-04 Thread Григорий Григоренко
Fri, 02 Nov 2012 15:32:44 +0100 от Clemens Ladisch clem...@ladisch.de: Igor Tandetnik wrote: SQLite does in fact accept CURRENT_TIMESTAMP in DEFAULT clause. http://sqlite.org/lang_createtable.html#tablecoldef SQLite does in fact accept CURRENT_TIMESTAMP anywhere:

Re: [sqlite] SUGGESTION: now as alias for strftime('%s','now')

2012-11-04 Thread Григорий Григоренко
Fri, 2 Nov 2012 10:25:18 -0400 от Richard Hipp d...@sqlite.org: On Fri, Nov 2, 2012 at 10:18 AM, Simon Davies simon.james.dav...@gmail.com wrote: datetime() will give current date and time likewise date(), time() etc If I read the original post correctly, I think the OP is requesting a

[sqlite] SQLite leaks memory

2012-11-04 Thread Igor Korot
Hi, ALL, I have a very interesting situation. I'm trying to compile my project using Visual Studio 2010. It is a C++ executable and I just inserted the source code from the amalgamation archive into the project. I also changed the settings for the sqlite3.c to be recognized as a C source code and

Re: [sqlite] SUGGESTION: now as alias for strftime('%s','now')

2012-11-04 Thread Григорий Григоренко
Fri, 2 Nov 2012 14:11:26 + от Black, Michael (IS) michael.bla...@ngc.com: CREATE TABLE t(id,time); INSERT INTO t VALUES(1,CURRENT_DATE); INSERT INTO t VALUES(2,CURRENT_TIMESTAMP); INSERT INTO t VALUES(3,datetime('now')); INSERT INTO t VALUES(4,date('now')); SELECT * FROM t;

Re: [sqlite] SUGGESTION: now as alias for strftime('%s','now')

2012-11-04 Thread Baruch Burstein
CURRENT_TIMESTAMP returns -MM-DD HH:MM:SS, not a unix timestamp. I think other DB systems all use this function to return a unix timestamp. On Sun, Nov 4, 2012 at 9:34 AM, Григорий Григоренко grigore...@mail.ruwrote: Fri, 2 Nov 2012 14:11:26 + от Black, Michael (IS)

Re: [sqlite] SUGGESTION: now as alias for strftime('%s','now')

2012-11-04 Thread Roger Andersson
-Ursprungligt meddelande- From: Baruch Burstein Sent: Sunday, November 04, 2012 10:43 AM To: Григорий Григоренко ; General Discussion of SQLite Database Subject: Re: [sqlite] SUGGESTION: now as alias for strftime('%s','now') CURRENT_TIMESTAMP returns -MM-DD HH:MM:SS, not a unix

Re: [sqlite] System.Data.SQLite.dll locks files forever starting fromv1.0.82.0

2012-11-04 Thread Alex Reitbort
Alex Reitbort wrote: When running this sample with System.Data.SQLite.dll v1.0.81 everything works ok. When running this sample with System.Data.SQLite.dll v1.0.82, it fails on File.Delete line with IOException: The process cannot access the file 'alex.db' because it is being used by

Re: [sqlite] SQLite leaks memory

2012-11-04 Thread Clemens Ladisch
Igor Korot wrote: When the user asks to edit the data it starts the transaction, then set the SAVEPOINT Why do you need a savepoint in addition to the transaction? Now the problem: only during the scenario #3 I have a lot of memory leaks. They are reported in the Visual Studio debug window.

Re: [sqlite] SUGGESTION: now as alias for strftime('%s','now')

2012-11-04 Thread Black, Michael (IS)
If speed and storage are a concern then as somebody else notedjulianday is the way to go. Just don't confuse CURRENT_TIMESTAMP with CURRENT_TIME -- you can still extract just date from the field if you need it. sqlite create table t(id,time); sqlite insert into t

Re: [sqlite] EXT :Re: Compiling SQLite3 with MSVC 2010

2012-11-04 Thread Black, Michael (IS)
Hmmm...interesting...I'm using VS 2010 Express 32-bit and I would've assumed the warnings would match. I also enabled SQLITE_64BIT_STATS to try and force the first warning but that didn't cause it. Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 That's a bit

[sqlite] Performance of sparse sqlite tables

2012-11-04 Thread Dominguez Bonini, David
Hi, I have an application where a table is filled with elements whose primary key is specified at insertion, and is actually a combination of several independent IDs. Example: ItemID = (id0 32) + (id1 16) + (id2). The range covered by each ID guarantees that their sum will never exceed the

Re: [sqlite] Performance of sparse sqlite tables

2012-11-04 Thread Pavel Ivanov
I'd say generally speaking your way of storing data has no significant downsides. There's just one but: if each row in your table stores pretty significant amount of data (blobs, long text fields or just lots of different fields) you'd better not make your ItemID INTEGER PRIMARY KEY. Because

Re: [sqlite] Performance of sparse sqlite tables

2012-11-04 Thread Simon Slavin
On 4 Nov 2012, at 5:26pm, Dominguez Bonini, David david.doming...@ikusi.com wrote: I have an application where a table is filled with elements whose primary key is specified at insertion, and is actually a combination of several independent IDs. Example: ItemID = (id0 32) + (id1 16) +

Re: [sqlite] SQLite leaks memory

2012-11-04 Thread Igor Korot
Hi, Clemens, On Sun, Nov 4, 2012 at 3:11 AM, Clemens Ladisch clem...@ladisch.de wrote: Igor Korot wrote: When the user asks to edit the data it starts the transaction, then set the SAVEPOINT Why do you need a savepoint in addition to the transaction? Because it is a transaction inside

Re: [sqlite] EXT :Re: Compiling SQLite3 with MSVC 2010

2012-11-04 Thread Igor Korot
Michael, On Sun, Nov 4, 2012 at 5:59 AM, Black, Michael (IS) michael.bla...@ngc.com wrote: Hmmm...interesting...I'm using VS 2010 Express 32-bit and I would've assumed the warnings would match. I also enabled SQLITE_64BIT_STATS to try and force the first warning but that didn't cause it.