Re: [sqlite] Statements that return a result set?

2009-07-30 Thread Dan Kennedy
On Jul 30, 2009, at 5:12 PM, Robert Villanoa wrote: > Hi folk, > > I am new to SQLite, and I have a question: In SQLite, is there a > statement apart from SELECT statement that can return a result set? > Or the SELECT statement is the only statement that can return a > result set? As

Re: [sqlite] Multi-master replication with updated Versioning?extension

2009-07-30 Thread Simon Slavin
On 30 Jul 2009, at 6:19pm, Jay A. Kreibich wrote: > You're not really supposed to > dump and restore a multi-master system. We're back to talking about synchronising different copies of the database again, aren't we ? Dumping and restoring a multi-master system means restoring the entire

Re: [sqlite] Looking for a w_char alternative to the sqlite3_mprintf famili of functions

2009-07-30 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A.J.Millan wrote: > Actually I have an application that regularly uses expresions as: > > char *zUserName = "My name"; > char *zSQL = sqlite3_mprintf ("INSERT INTO table VALUES('%q')", zUserName); Why aren't you using bound parameters? It is far

Re: [sqlite] DELETE ststement not working as expected

2009-07-30 Thread John Loveys
Thanks Shane, but I do not believe that is the issue. I bind these values in my INSERT statements and it works fine. Otherwise I wouldn't have a DELETE problem, would I? ;) Also, the values are acceptable if I try my DELETE at the SQLite command prompt. -Original Message- From:

Re: [sqlite] DELETE ststement not working as expected

2009-07-30 Thread Shane Harrelson
I believe sqlite3_bind_int64() takes a signed int for the value to bind. You state you are passing it a large unsigned int. If the unsigned value is large enough, it will appear to be a negative signed int. HTH. -Shane ___ sqlite-users mailing list

[sqlite] DELETE ststement not working as expected

2009-07-30 Thread John Loveys
Hi All I have the following simple table: CREATE TABLE log ( Channel INT, Start_Time INT, End_Time INT, Data_Value BLOB); And I have this delete statement: DELETE FROM log WHERE Start_Time <= ?; I prepare this statement when I open the database, along with a bunch of others. I keep

Re: [sqlite] search time is non-determinate in multi-thread enviroment

2009-07-30 Thread Lawrence Gold
On Jul 28, 2009, at 8:09 PM, pierr wrote: > http://www.sqlite.org/threadsafe.html > "Multi-thread. In this mode, SQLite can be safely used by multiple > threads > provided that no single database connection is used simulataneously > in two > or more threads." > > If I have one(different)

Re: [sqlite] sqlite version 2.8 vs 3.x

2009-07-30 Thread David Bicking
On Thu, 2009-07-30 at 09:18 -0430, An wrote: > my question stayed unanswered, so that is why i'm repeating it on the > mailinglist: > > if sqlite2.8 will be supported of bugs the following years, as the web page > says, what is another reason for working with version 3.x instead of 2.8 ? > > i'm

Re: [sqlite] Multi-master replication with updated Versioning?extension

2009-07-30 Thread Jay A. Kreibich
On Thu, Jul 30, 2009 at 08:33:10PM +0400, Alexey Pechnikov scratched on the wall: > Hello! > > On Thursday 30 July 2009 19:47:39 Jay A. Kreibich wrote: > > Then again, given that ROWID values are signed 64 bit values, you > > could just start each master at some offset (like

[sqlite] Looking for a w_char alternative to the sqlite3_mprintf famili of functions

2009-07-30 Thread A.J.Millan
Hi list: Actually I have an application that regularly uses expresions as: char *zUserName = "My name"; char *zSQL = sqlite3_mprintf ("INSERT INTO table VALUES('%q')", zUserName); Because of internationalization I need use Unicode instead of ASCII chars: w_char *zwUserName = L"My Chinese

Re: [sqlite] Statements that return a result set?

2009-07-30 Thread Simon Slavin
On 30 Jul 2009, at 11:12am, Robert Villanoa wrote: > I am new to SQLite, and I have a question: In SQLite, is there a > statement apart from SELECT statement that can return a result set? > Or the SELECT statement is the only statement that can return a > result set PRAGMA will, but only

Re: [sqlite] Multi-master replication with updated Ver sioning extension

2009-07-30 Thread Alexey Pechnikov
Hello! On Thursday 30 July 2009 19:47:39 Jay A. Kreibich wrote: > Then again, given that ROWID values are signed 64 bit values, you > could just start each master at some offset (like +0x00FF) > and not worry about it. It would still be a good idea to force all > the tables

Re: [sqlite] Multi-master replication with updated Versioning extension

2009-07-30 Thread Jay A. Kreibich
On Thu, Jul 30, 2009 at 06:11:42PM +0400, Alexey Pechnikov scratched on the wall: > Hello! > > On Thursday 30 July 2009 17:25:15 P Kishor wrote: > > > I haven't looked at your work in depth, but I am interested in this. I > > > have implemented a very simple versioning system with TRIGGERs

Re: [sqlite] Multi-master replication with updated Ver sioning extension

2009-07-30 Thread Alexey Pechnikov
Hello! On Thursday 30 July 2009 18:17:45 Jim Showalter wrote: > MD5 hashes can still collide. How does this implementation deal with > hash collisions? You may use any other hash (sha256 as example). But I think md5 collisions is not the problem for common applications. Best regards, Alexey

Re: [sqlite] Multi-master replication with updated Versioning extension

2009-07-30 Thread Jim Showalter
MD5 hashes can still collide. How does this implementation deal with hash collisions? - Original Message - From: "Alexey Pechnikov" To: "General Discussion of SQLite Database" Sent: Thursday, July 30, 2009 7:11 AM Subject: Re: [sqlite]

Re: [sqlite] Multi-master replication with updated Versioning extension

2009-07-30 Thread Alexey Pechnikov
Hello! On Thursday 30 July 2009 17:25:15 P Kishor wrote: > > I haven't looked at your work in depth, but I am interested in this. I > > have implemented a very simple versioning system with TRIGGERs whereby > > every change (INSERT, UPDATE, DELETE) in a column in a table is stored > > in a

[sqlite] sqlite version 2.8 vs 3.x

2009-07-30 Thread An
my question stayed unanswered, so that is why i'm repeating it on the mailinglist: if sqlite2.8 will be supported of bugs the following years, as the web page says, what is another reason for working with version 3.x instead of 2.8 ? i'm working with xampp-lite server that comes bundled with

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] Multi-master replication with updated Versioning extension

2009-07-30 Thread P Kishor
On Thu, Jul 30, 2009 at 7:42 AM, P Kishor wrote: > Alexey, > > > On Thu, Jul 30, 2009 at 4:42 AM, Alexey Pechnikov > wrote: >> Hello! >> >> Please see >> http://mobigroup.ru/files/sqlite-ext/versioning/ > > I haven't looked at your work in depth, but I

[sqlite] [OpenSQL Camp] OpenSQL Camp, November 2009 in Portland, OR (fwd)

2009-07-30 Thread Rich Shepard
For those who are interested. Rich -- Richard B. Shepard, Ph.D. | IntegrityCredibility Applied Ecosystem Services, Inc.|Innovation Voice: 503-667-4517 Fax: 503-667-8863 -- Forwarded message

Re: [sqlite] Insert multiple entries in a single INSERT statement

2009-07-30 Thread CityDev
Kees Nuyt wrote: > > > Insert one row at a time. > > > Presumably you can do this kind of thing: INSERT INTO Table2 ( [FieldX] ) SELECT FieldY FROM Table1; -- View this message in context:

Re: [sqlite] Multi-master replication with updated Versioning extension

2009-07-30 Thread P Kishor
Alexey, On Thu, Jul 30, 2009 at 4:42 AM, Alexey Pechnikov wrote: > Hello! > > Please see > http://mobigroup.ru/files/sqlite-ext/versioning/ I haven't looked at your work in depth, but I am interested in this. I have implemented a very simple versioning system with

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

[sqlite] Closure

2009-07-30 Thread CityDev
As an aside, a principle of the relational model is that operations on relations should produce a relation. This caused a bit of a problem early on as if you perform a Project operation ie cut down the number of fields, you can finish up with 'duplicate' rows ie rows that can't be distinguished.

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

Re: [sqlite] Use of Transaction with in memory db

2009-07-30 Thread Igor Tandetnik
Sharma, Gaurav wrote: > 1- Is there any significance of using transaction (whether auto > commit or manual) with in memory database. Yes. Transactions work on in-memory databases the same way they do for regular databases. > 2- If the answer of first question is "yes" then second question >

Re: [sqlite] Statements that return a result set?

2009-07-30 Thread Igor Tandetnik
Robert Villanoa wrote: > I am new to SQLite, and I have a question: In SQLite, is there a > statement apart from SELECT statement that can return a result set? PRAGMA, EXPLAIN Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Use of in memory db

2009-07-30 Thread Igor Tandetnik
Sharma, Gaurav wrote: > Is there any way through which without using the mutex lock mechanism > multiple threads can perform INSERT in bulk on same memory db. What I > assume is if I share an in memory db connection handle across threads > then it will not be sqlite's responsibility but the user's

Re: [sqlite] Statements that return a result set?

2009-07-30 Thread P Kishor
On Thu, Jul 30, 2009 at 5:12 AM, Robert Villanoa wrote: > Hi folk, > > I am new to SQLite, and I have a question: In SQLite, is there a statement > apart from SELECT statement that can return a result set? Or the SELECT > statement is the only statement that can return

Re: [sqlite] Use of in memory db

2009-07-30 Thread Pavel Ivanov
> What I assume is if I share an in memory db connection handle across threads > then it will not be sqlite's responsibility but the user's responsibility to > protect multiple insert/update statements. On the other hand if the > connection to physical db is shared amongst threads then sqlite

[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,

[sqlite] Statements that return a result set?

2009-07-30 Thread Robert Villanoa
Hi folk, I am new to SQLite, and I have a question: In SQLite, is there a statement apart from SELECT statement that can return a result set? Or the SELECT statement is the only statement that can return a result set? Thank you for reading my question! Robert.

[sqlite] Multi-master replication with updated Versioning extension

2009-07-30 Thread Alexey Pechnikov
Hello! Please see http://mobigroup.ru/files/sqlite-ext/versioning/ Master-slave may use ROWIDs and multy-master may use md5 hash of full record. This is test version and I'm glad to get any comments and ideas. P.S. md5 extension sources is here http://mobigroup.ru/files/sqlite-ext/md5/ Best

Re: [sqlite] Reasons for SQLITE_BUSY

2009-07-30 Thread Edzard Pasma
--- nikol...@rath.org wrote: > "Igor Tandetnik" writes: >> Nikolaus Rath wrote: >>> I am accessing the same database from different threads. Each thread >>> has its own connection. I have set the busy timeout for each >>> connection to 5000 milliseconds.