[sqlite] Need help

2011-03-31 Thread Balasubramani Vivekkanandan
Hello, I am very new database development and sqlite. I have a requirement where I want to restrict the size of my integer primary key to 3 bytes. In my database, entries will be added and removed very frequently. So If the primary key limit of 3 bytes is reached, it should try to reuse the

Re: [sqlite] mutex assert_fail in btreeInvokeBusyHandler occasionally in a periodic DB update in 3.5.7, It's ok in 3.6.22(-DSQLITE_THREADSAFE=1)

2011-03-31 Thread Black, Michael (IS)
Since it apperas you're running your commit in a separate thread and are therefore muilti-threaded I do belive you need: SQLITE3_THREADSAFE=2 From http://www.sqlite.org/compile.html#threadsafe To put it another way, SQLITE_THREADSAFE=1 sets the default threading mode to Serialized.

Re: [sqlite] Need help

2011-03-31 Thread Igor Tandetnik
Balasubramani Vivekkanandan bvivekkanan...@mvista.com wrote: I am very new database development and sqlite. I have a requirement where I want to restrict the size of my integer primary key to 3 bytes. In my database, entries will be added and removed very frequently. So If the primary key

Re: [sqlite] Need help

2011-03-31 Thread Oliver Peters
Igor Tandetnik itandetnik@... writes: Balasubramani Vivekkanandan bvivekkanandan@... wrote: I am very new database development and sqlite. I have a requirement where I want to restrict the size of my integer primary key to 3 bytes. In my database, entries will be added and removed

Re: [sqlite] Need help

2011-03-31 Thread Oliver Peters
Igor Tandetnik itandetnik@... writes: Balasubramani Vivekkanandan bvivekkanandan@... wrote: I am very new database development and sqlite. I have a requirement where I want to restrict the size of my integer primary key to 3 bytes. In my database, entries will be added and removed

[sqlite] using sqlite3_get_table

2011-03-31 Thread john darnell
All I need to do is see how many rows a table has. I stumbled across this function and used it thusly in my code (I removed the error checking for the sake of brevity): Result = sqlite3_initialize(); sqlite3 *db_ptr; Result = 0; Result = sqlite3_open_v2(DBEnginePath, db_ptr,

[sqlite] using sqlite3_get_table --additional info...

2011-03-31 Thread john darnell
BTW, if there is a better way to get a row count without using sqlite3_get_table() that would also work. _ From: john darnell Sent: Thursday, March 31, 2011 9:27 AM To: 'General Discussion of SQLite Database' Subject: using sqlite3_get_table All I

Re: [sqlite] using sqlite3_get_table --additional info...

2011-03-31 Thread Mr. Puneet Kishor
On Mar 31, 2011, at 9:30 AM, john darnell wrote: BTW, if there is a better way to get a row count without using sqlite3_get_table() that would also work. maybe I am missing something, but what is wrong with SELECT Count(*) FROM table? _

Re: [sqlite] using sqlite3_get_table --additional info...

2011-03-31 Thread Michael Steiger
On 31.03.2011 16:30 john darnell said the following: BTW, if there is a better way to get a row count without using sqlite3_get_table() that would also work. This will work withput fetching the table dbrc = sqlite3_prepare_v2 (db, select count(*) from table, -1, stmt, NULL); if

Re: [sqlite] using sqlite3_get_table

2011-03-31 Thread Igor Tandetnik
On 3/31/2011 10:27 AM, john darnell wrote: All I need to do is see how many rows a table has. select count(*) from TableName; char ***CArray = NULL; int iRow, iCol; char **err = NULL; sqlite3_get_table(db_ptr, Select * from Admin, CArray,iRow,iCol, err); char** CArray =

[sqlite] sqlite3_step() error and constraints

2011-03-31 Thread Julien Laffaye
Hi, When sqlite3_step() fail because a UNIQUE constraint is not satisfied, it returns SQLITE_ERROR. I see that there is an error code named SQLITE_CONSTRAINT. Why sqlite3_step() does not return this one? Having a specific error code would be useful to warn the user that the data he submitted

Re: [sqlite] sqlite3_step() error and constraints

2011-03-31 Thread Igor Tandetnik
On 3/31/2011 2:02 PM, Julien Laffaye wrote: When sqlite3_step() fail because a UNIQUE constraint is not satisfied, it returns SQLITE_ERROR. I see that there is an error code named SQLITE_CONSTRAINT. Why sqlite3_step() does not return this one? For reasons described in the documentation:

Re: [sqlite] sqlite3_step() error and constraints

2011-03-31 Thread Julien Laffaye
On 03/31/2011 19:08, Igor Tandetnik wrote: On 3/31/2011 2:02 PM, Julien Laffaye wrote: When sqlite3_step() fail because a UNIQUE constraint is not satisfied, it returns SQLITE_ERROR. I see that there is an error code named SQLITE_CONSTRAINT. Why sqlite3_step() does not return this one?

Re: [sqlite] sqlite3_step() error and constraints

2011-03-31 Thread Pavel Ivanov
http://sqlite.org/c3ref/step.html . See Goofy Interface Alert section at the bottom. I believe it was changed with recent versions of SQLite. Is call to sqlite3_extended_result_codes (http://www.sqlite.org/c3ref/extended_result_codes.html) not needed anymore? Pavel On Thu, Mar 31, 2011 at

Re: [sqlite] sqlite3_step() error and constraints

2011-03-31 Thread Igor Tandetnik
On 3/31/2011 2:12 PM, Pavel Ivanov wrote: http://sqlite.org/c3ref/step.html . See Goofy Interface Alert section at the bottom. I believe it was changed with recent versions of SQLite. Is call to sqlite3_extended_result_codes (http://www.sqlite.org/c3ref/extended_result_codes.html) not needed

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

2011-03-31 Thread Mike Rychener
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? Explorer doesn't recognize VAR or VARIANCE either. I tried

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

2011-03-31 Thread Igor Tandetnik
On 3/31/2011 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? Explorer doesn't

Re: [sqlite] sqlite3_step() error and constraints

2011-03-31 Thread Simon Slavin
On 31 Mar 2011, at 7:08pm, Igor Tandetnik wrote: For reasons described in the documentation: http://sqlite.org/c3ref/step.html . See Goofy Interface Alert section at the bottom. giggle Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

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? See

[sqlite] WAL checkpoints not working

2011-03-31 Thread Dave White
I can't get WAL checkpoints to work, automatically or forced. The WAL file seems to grow forever until the database is shutdown. I have tried: sqlite3_wal_checkpoint() and PRAGMA wal_checkpoint (with all different options) My 84MB data file is now paired with a

Re: [sqlite] WAL checkpoints not working

2011-03-31 Thread Richard Hipp
On Thu, Mar 31, 2011 at 4:44 PM, Dave White dwh...@companioncorp.comwrote: I can't get WAL checkpoints to work, automatically or forced. The WAL file seems to grow forever until the database is shutdown. I have tried: sqlite3_wal_checkpoint() and PRAGMA

Re: [sqlite] WAL checkpoints not working

2011-03-31 Thread Nico Williams
On Thu, Mar 31, 2011 at 3:48 PM, Richard Hipp d...@sqlite.org wrote: On Thu, Mar 31, 2011 at 4:44 PM, Dave White dwh...@companioncorp.comwrote: Any ideas why this would happen? You have a read transaction being held open.  The checkpoint cannot run to completion when there is a read

[sqlite] block alter table command / table Constraints

2011-03-31 Thread RAKESH HEMRAJANI
Hi Team, Need ur expertise with below 2 problems 1) how to make a table read only, such that any user can only insert but can't update (table schema) or drop the table alter table / drop table arent allowed on sqlite_master, need similar restrictions on my custom table. by

Re: [sqlite] block alter table command / table Constraints

2011-03-31 Thread Igor Tandetnik
On 3/31/2011 10:12 PM, RAKESH HEMRAJANI wrote: 1) how to make a table read only, such that any user can only insert but can't update (table schema) or drop the table alter table / drop table arent allowed on sqlite_master, need similar restrictions on my custom table. by

Re: [sqlite] block alter table command / table Constraints

2011-03-31 Thread Simon Slavin
On 1 Apr 2011, at 3:12am, RAKESH HEMRAJANI wrote: 1) how to make a table read only, such that any user can only insert but can't update (table schema) or drop the table alter table / drop table arent allowed on sqlite_master, need similar restrictions on my custom table. by

Re: [sqlite] block alter table command / table Constraints

2011-03-31 Thread Simon Slavin
On 1 Apr 2011, at 3:25am, Simon Slavin wrote: On 1 Apr 2011, at 3:12am, RAKESH HEMRAJANI wrote: 1) how to make a table read only, such that any user can only insert but can't update (table schema) or drop the table alter table / drop table arent allowed on sqlite_master, need