Re: [sqlite] how to get file handle from sqlite3 object?

2007-10-09 Thread Cyrus Durgin
Maybe it would help to state my use case: without this functionality, what is the proper way to copy a database using the C API without introducing a race condition? On 10/9/07, Robert Simpson <[EMAIL PROTECTED]> wrote: > > > -Original Message- > > From: Cyrus Durgin [mailto:[EMAIL PROTECT

Re: [sqlite] how to get file handle from sqlite3 object?

2007-10-09 Thread Joe Wilson
--- Cyrus Durgin <[EMAIL PROTECTED]> wrote: > i'm wondering if there's a "standard" way to get an open file handle from an > sqlite3 pointer using the C API. anyone know? Patch below implements getting a file descriptor for a UNIX database using the existing sqlite3 API function sqlite3_file_con

RE: [sqlite] how to get file handle from sqlite3 object?

2007-10-09 Thread Robert Simpson
> -Original Message- > From: Cyrus Durgin [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 09, 2007 5:02 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] how to get file handle from sqlite3 object? > > i'm wondering if there's a "standard" way to get an open file > handle from an >

RE: [sqlite] sqlite3_exec function error:database is locked

2007-10-09 Thread kirrthana M
You would have not closed the database after usage,just check wheather you have closed the database. -Original Message- From: varunkumar [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 9:25 PM To: sqlite-users@sqlite.org Subject: [sqlite] sqlite3_exec function error:database is l

Re: [sqlite] how to get file handle from sqlite3 object?

2007-10-09 Thread Joe Wilson
--- Cyrus Durgin <[EMAIL PROTECTED]> wrote: > i'm wondering if there's a "standard" way to get an open file handle from an > sqlite3 pointer using the C API. anyone know? No such function exists, but it would be a useful addition to the API. Copying the database during an exclusive lock without s

Re: [sqlite] how to get file handle from sqlite3 object?

2007-10-09 Thread Vitali Lovich
Can you please clarify why this would be needed? Sqlite databases are opened by name, thereby you can use standard OS or stdlib functions to open the same file with a different handle. Cyrus Durgin wrote: i'm wondering if there's a "standard" way to get an open file handle from an sqlite3 poi

Re: [sqlite] SELECT crashes with small cache?

2007-10-09 Thread Richard Klein
Joe Wilson wrote: --- Richard Klein <[EMAIL PROTECTED]> wrote: I am seeing SQLite crashing during execution of a SELECT statement when I make the page cache very small (40 pages). When I bump the cache up to 50 pages, the problem goes away. The problem only occurs on my RISC platform, not on m

[sqlite] how to get file handle from sqlite3 object?

2007-10-09 Thread Cyrus Durgin
i'm wondering if there's a "standard" way to get an open file handle from an sqlite3 pointer using the C API. anyone know? -- Cyrus. <[EMAIL PROTECTED]>

Re: [sqlite] auto library function loading

2007-10-09 Thread Kees Nuyt
On Tue, 9 Oct 2007 07:06:48 -0700 (PDT), you wrote: > Is there a way for SQLITE to automatically load user > defined functions at database instantiation or upon > database connection? You can put a file .sqliterc in the users homedirectory with commands for the command line tool. They will be ex

Re: [sqlite] auto library function loading

2007-10-09 Thread Ken
John, Kind of defeats the point of "automatic". Using a wrapper for application code is perfectly legitimate. However it does not address the sqlite3 command line tool. The ability to automatically load a library of functions via a dll would be a really nice feature and could be used to pro

Re: [sqlite] sqlite3_exec function error:database is locked

2007-10-09 Thread John Stanton
varunkumar wrote: i am using sqlite3 database in our project in my project one daemon process running , in this daemon process i am opening the data base and inserts the data in to sqlite3database using sqlite3_exec() API . for every one minute i am opening the database and inserts th

[sqlite] sqlite3_exec function error:database is locked

2007-10-09 Thread varunkumar
i am using sqlite3 database in our project in my project one daemon process running , in this daemon process i am opening the data base and inserts the data in to sqlite3database using sqlite3_exec() API . for every one minute i am opening the database and inserts the values in to datab

[sqlite] Re: Reading error outside the while

2007-10-09 Thread Igor Tandetnik
[EMAIL PROTECTED] wrote: sqlite3_open(dbname, &db); sqlite3_prepare_v2(db, sql, -1, &pStat, 0); while(sqlite3_step(pStat) == SQLITE_ROW) { row = (char *)sqlite3_column_text(pStat, 0); my_array[i] = malloc( sizeof row * sizeof *my_array[i]); memcpy (my_array[i], row, sizeof row * sizeof

Re[2]: [sqlite] Reading error outside the while

2007-10-09 Thread Teg
The original example's an accident waiting to happen. You've hard coded the results to 3 but, not limited the number of loops in the while loop so, you could easily crash/corrupt the stack. You'll crash if you have less than 3 results too. What happens if you only get one result from the while lo

Re: [sqlite] auto library function loading

2007-10-09 Thread John Stanton
Ken wrote: Is there a way for SQLITE to automatically load user defined functions at database instantiation or upon database connection? Can it test for a .so/.dll and perform a call to load user functions? If the .dll does not exist maybe issue a warning? Just a thought as a way to al

Re: [sqlite] Reading error outside the while

2007-10-09 Thread [EMAIL PROTECTED]
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". #include #include int main(void) { sqlite3 *

Re: [sqlite] Reading error outside the while

2007-10-09 Thread [EMAIL PROTECTED]
Simon Davies a écrit : On 09/10/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". . . . const uns

Re: [sqlite] Reading error outside the while

2007-10-09 Thread Ken
You need to make a copy of the str instead of just capturing a pointer reference. try: my_array[i] = strdup(sqlite3_column_text(pStat, 0)); "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok,

Re: [sqlite] Reading error outside the while

2007-10-09 Thread John Stanton
[EMAIL PROTECTED] wrote: Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". #include #include int main(void) { sqlite3 *db; sqlite3_stmt *pSta

[sqlite] auto library function loading

2007-10-09 Thread Ken
Is there a way for SQLITE to automatically load user defined functions at database instantiation or upon database connection? Can it test for a .so/.dll and perform a call to load user functions? If the .dll does not exist maybe issue a warning? Just a thought as a way to allow users t

Re: [sqlite] Reading error outside the while

2007-10-09 Thread Simon Davies
On 09/10/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I got an error when I try to read some data outside the while{}, inside the > while{} it's ok, an idea ? > test.db have just one "table1" and a "field1" with values "one", "two", > "three". . . . >const unsigned char *my

[sqlite] Reading error outside the while

2007-10-09 Thread [EMAIL PROTECTED]
Hello, I got an error when I try to read some data outside the while{}, inside the while{} it's ok, an idea ? test.db have just one "table1" and a "field1" with values "one", "two", "three". #include #include int main(void) { sqlite3 *db; sqlite3_stmt *pStat; const char *dbname =

Re: [sqlite] Null-ifying the columns

2007-10-09 Thread Dan Kennedy
On Mon, 2007-10-08 at 02:03 -0700, chetana bhargav wrote: > SQL Guru's, > > Want to know is there any easy way to make all the columns in a particular > row to NULL other than specifying column name and NULL value, no delete as > that would change the row-id What happens if you do: INSERT OR