Re: [sqlite] sqlite3_get_table() failed with error "database is locked"

2018-10-04 Thread Simon Slavin
On 4 Oct 2018, at 10:57am, ldl wrote: > Just the same application started in multiple processes doing the same > things. The accesses to the db were all readonly. > > > I print the error from sqlite3_get_table(). The error is "database is locked". Set a timeout of 60,000ms and see whether

Re: [sqlite] sqlite3_get_table() failed with error "database is locked"

2018-10-04 Thread ldl
Hi Clemens, Just the same application started in multiple processes doing the same things. The accesses to the db were all readonly. I print the error from sqlite3_get_table(). The error is "database is locked". Thanks, Liu At 2018-09-24 18:27:24, "Clemens Ladisch" wrote: >ldl

Re: [sqlite] sqlite3_get_table() failed with error "database is locked"

2018-09-24 Thread Clemens Ladisch
ldl wrote: > Multiple applications called sqlite3_get_table() to read data in a same db > file at the same time, got error "database is locked" Somebody has a write lock. > Why read-only access is locked? Because one access is not read only. > How to resolve the issue? Find out who locked

[sqlite] sqlite3_get_table() failed with error "database is locked"

2018-09-23 Thread ldl
Hi, Multiple applications called sqlite3_get_table() to read data in a same db file at the same time, got error "database is locked"? Why read-only access is locked? How to resolve the issue? Thanks, Liu ___ sqlite-users mailing list

Re: [sqlite] sqlite3_get_table() vs sqlite3_step

2010-11-21 Thread Tito Ciuro
Hi Igor, No, no... I really meant a roundtrips to disk. So, while sqlite3_get_table() seemed like a faster but memory hungry mechanism to retrieve the result set, sqlite3_step() seemed that it would take longer, especially in disk-based systems, but more memory-efficient. Thanks for pointing

Re: [sqlite] sqlite3_get_table() vs sqlite3_step

2010-11-21 Thread Tito Ciuro
Thanks a lot Max! -- Tito On 21 Nov 2010, at 14:04, Max Vlasov wrote: > On Sun, Nov 21, 2010 at 6:31 PM, Tito Ciuro wrote: > >> Hello, >> >> Sounds like sqlite3_get_table() would take less time to access the storage >> subsystem as opposed to

Re: [sqlite] sqlite3_get_table() vs sqlite3_step

2010-11-21 Thread Igor Tandetnik
Tito Ciuro wrote: > Let me start by saying that I'm aware that sqlite3_get_table() should not be > used (as per the documentation). I'm curious about > one thing though: if the computer/device has sufficient memory to hold the > result set returned by sqlite3_get_table(),

Re: [sqlite] sqlite3_get_table() vs sqlite3_step

2010-11-21 Thread Max Vlasov
On Sun, Nov 21, 2010 at 6:31 PM, Tito Ciuro wrote: > Hello, > > Sounds like sqlite3_get_table() would take less time to access the storage > subsystem as opposed to sqlite_step() with multiple roundtrips, at the > expense of using lots more RAM, of course. So assuming RAM wasn't

[sqlite] sqlite3_get_table() vs sqlite3_step

2010-11-21 Thread Tito Ciuro
Hello, Let me start by saying that I'm aware that sqlite3_get_table() should not be used (as per the documentation). I'm curious about one thing though: if the computer/device has sufficient memory to hold the result set returned by sqlite3_get_table(), wouldn't it be more optimized

Re: [sqlite] sqlite3_get_table and probable memory leak

2009-07-30 Thread Maciej Miszczak
Thanks, Pavel, for your all-embracing answer. I'll dig in this topic. Cheers, Maciej ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sqlite3_get_table and probable memory leak

2009-07-30 Thread Pavel Ivanov
> Is lowering the PRAGMA cache_size a good way to fix this? Yes, it's the only way to fix this. Though IIRC you cannot lower it below 10, so 10 pages will be always stored in memory. OTOH you can implement your own version of page cache that will not leave pages in memory at all (for more

Re: [sqlite] sqlite3_get_table and probable memory leak

2009-07-30 Thread Maciej Miszczak
Pavel, you're great! There's nothing better than to just ask the right people. Calling sqlite3_close after the mentioned function solved the problem. By the way I got something like this: > - 0x0005e688 Free 28 was never alloc'd 0x400f3ec4 > - 0x0005e750 Free 29 was never alloc'd 0x400f3ec4 > -

[sqlite] sqlite3_get_table and probable memory leak

2009-07-30 Thread Maciej Miszczak
Hi, I have a simple function (used to get only one value from a database), as shown below, and I've struggled with it for a long time, without success. I use libsqlite3.6.13. > int Database::execute(std::string query, std::string* result, > std::string* errMsg) > { > int rc, tmpRowsCount,

Re: [sqlite] sqlite3_get_table question

2008-12-30 Thread schachtobi
Mon, 29 Dec 2008 11:20:58 +0700 >>> From: Dan <danielk1...@gmail.com> >>> Subject: Re: [sqlite] sqlite3_get_table question >>> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> >>> Message-ID: <65fa0cc6-4248-4675-8100-f069423e0...@gmail

Re: [sqlite] sqlite3_get_table question

2008-12-29 Thread Dan
On Dec 30, 2008, at 1:29 AM, schachtobi wrote: > >> Date: Mon, 29 Dec 2008 11:20:58 +0700 >> From: Dan <danielk1...@gmail.com> >> Subject: Re: [sqlite] sqlite3_get_table question >> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>

Re: [sqlite] sqlite3_get_table question

2008-12-29 Thread schachtobi
> Date: Mon, 29 Dec 2008 11:20:58 +0700 > From: Dan <danielk1...@gmail.com> > Subject: Re: [sqlite] sqlite3_get_table question > To: General Discussion of SQLite Database <sqlite-users@sqlite.org> > Message-ID: <65fa0cc6-4248-4675-8100-f069423e0...@gmail.

Re: [sqlite] sqlite3_get_table question

2008-12-28 Thread Dan
On Dec 29, 2008, at 7:57 AM, schachtobi wrote: > Hi, > > I retrieve data (1 row only) via the handy getTable function. Inside > this row is one blob object with pixeldata. > > The size is: > 256*256 Pixels with 3 bytes each > -> 256*256*3 = 196608 Bytes > > select length(data) from ch; > > gives

[sqlite] sqlite3_get_table question

2008-12-28 Thread schachtobi
Hi, I retrieve data (1 row only) via the handy getTable function. Inside this row is one blob object with pixeldata. The size is: 256*256 Pixels with 3 bytes each -> 256*256*3 = 196608 Bytes select length(data) from ch; gives me exactly this number. No I try this: typedef struct {

Re: [sqlite] sqlite3_get_table only get 16 rows

2008-03-11 Thread James
Sorry, I have already solved! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James Sent: Tuesday, March 11, 2008 4:34 PM To: sqlite-users@sqlite.org Subject: [sqlite] sqlite3_get_table only get 16 rows Hi, I use command-line to query

[sqlite] sqlite3_get_table only get 16 rows

2008-03-11 Thread James
Hi, I use command-line to query the table: # sqlite3 listtable sqlite> select Name,Value from TblDeviceInfo; AdditionalHardwareVersion AdditionalSoftwareVersion Description DeviceLog DeviceStatus EnabledOptions FirstUseDate HardwareVersion

Re: [sqlite] sqlite3_get_table

2008-03-05 Thread Dan
On Mar 6, 2008, at 10:57 AM, Kenneth LO wrote: > In previous versions (<=3.4.10) I use to do if (errmsg) { free(errmsg) > ; } without problem. > > In 3.5.6 the free() will segfault (yes, even after if) with a "invalid > pointer" message. > > It's my old understanding that sqlite3_get_table

[sqlite] sqlite3_get_table

2008-03-05 Thread Kenneth LO
In previous versions (<=3.4.10) I use to do if (errmsg) { free(errmsg) ; } without problem. In 3.5.6 the free() will segfault (yes, even after if) with a "invalid pointer" message. It's my old understanding that sqlite3_get_table (previously sqlite_get_table) will malloc for *errmsg and I'll

Re: [sqlite] sqlite3_get_table(); How to get all column names in C?

2008-01-05 Thread Dennis Cote
Jerry Krinock wrote: Is there any way to get a list of all column names in a table via the C API, which works even when there are no data rows in the table? Jerry, You can get the column names for any query, including a "select * from table", using the prepared statement APIs. After you

Re: [sqlite] sqlite3_get_table(); How to get all column names in C?

2008-01-02 Thread Jerry Krinock
On 2008 Jan, 02, at 15:52, Jay Sprenkle wrote: Did you try to query the table 'sqlite_master'? You can get the schema for any table by referencing the query results.. Thank you, Jay. I kept getting syntax errors when I tried that; apparently I don't know how to query the sqlite_master.

Re: [sqlite] sqlite3_get_table(); How to get all column names in C?

2008-01-02 Thread Jay Sprenkle
Did you try to query the table 'sqlite_master'? You can get the schema for any table by referencing the query results.. On Jan 2, 2008 4:52 PM, Jerry Krinock <[EMAIL PROTECTED]> wrote: > Is there any way to get a list of all column names in a table via the > C API, which works even when there are

[sqlite] sqlite3_get_table(); How to get all column names in C?

2008-01-02 Thread Jerry Krinock
Is there any way to get a list of all column names in a table via the C API, which works even when there are no data rows in the table? The example given for sqlite3_get_table() indicates that the column names are returned as the "zeroth" row. Indeed, it states: "In general, the number of

[sqlite] sqlite3_get_table question

2007-11-23 Thread Martin Pelletier
Hello, I am using an SQLite to host data for various projects, some of which take up significant place with some large monolithic tables (around 750 MB). Querying goes through the DLL using a call to SQLite3_get_table. The function allocates memory space to record the table in chars, even if

[sqlite] sqlite3_get_table and non-strings

2006-09-22 Thread Mark Richards
Although it does not appear to be mentioned in the documentation, is it correct to assume that sqlite3_get_table can only handle string datatypes? In a particular problem I am working a query is made to return an integer and three string fields. The issue may have more to do with the wrapper

Re: [sqlite] sqlite3_get_table fails in SQL Lite version 3.0.7, sqlite_get_table works in SLQ Lite Version 2.8.15 -

2004-10-07 Thread Paolo Vernazza
Steve Frierdich wrote: In the Sqlite version 2.8.15 I used the sqlite_get_table function that works with a return value of SQLITE_OK. In the Sqlite version 3.0.7 I used the sqlite3_get_table function that fails with a return value of 26, which is: "File opened that is not a database file ".

[sqlite] sqlite3_get_table fails in SQL Lite version 3.0.7, sqlite_get_table works in SLQ Lite Version 2.8.15 -

2004-10-07 Thread Steve Frierdich
In the Sqlite version 2.8.15 I used the sqlite_get_table function that works with a return value of SQLITE_OK. In the Sqlite version 3.0.7 I used the sqlite3_get_table function that fails with a return value of 26, which is: "File opened that is not a database file ". Both version used the