Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO

2013-02-26 Thread Pavel Ivanov
On Tue, Feb 26, 2013 at 2:29 PM, Igor Tandetnik wrote: > On 2/26/2013 5:13 PM, anydacdev anydacdev wrote: >> >> I am struggling with SQLite's support for Oracle's DUAL table. >> >> The updated statement, now including Oracle's DUAL looks like. >> >> MERGE INTO x TGT >> USING

Re: [sqlite] Memory DB - Query does not return all records after Update

2013-02-26 Thread Pavel Ivanov
> Example, If I insert 10 records and loop a query I receive > 10, 10, 10, 10, results > But, if I change one of the records during the loop I get > 10, 10, update record, 9, 10, This sounds gibberish. Could you please post your database schema and exact queries you issue in the exact

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Gilles Ganault
On Tue, 26 Feb 2013 18:44:28 -0500, Kevin Benson wrote: >The directory doesn't *HAVE* to be called ...\Externals. You pick the name, >any name, and then tell Visual Studio, that is all ;-) Right, but while the first DLL will be found since it's now part of the project

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Kevin Benson
On Tue, Feb 26, 2013 at 5:37 PM, Gilles Ganault wrote: > On Tue, 26 Feb 2013 13:09:10 -0500, Kevin Benson > < kevin.m.ben...@gmail.com> wrote: > > Because there are actually a number of different ways the (CLR)untime > > locates assemblies, I ~believe~ the FAQ only

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Gilles Ganault
On Tue, 26 Feb 2013 13:09:10 -0500, Kevin Benson wrote: >Because there are actually a number of different ways the (CLR)untime >locates assemblies, I ~believe~ the FAQ only attempts to offer a general >advisement about the "Externals" folder as a *HINT*. The rest is up

Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO

2013-02-26 Thread Igor Tandetnik
On 2/26/2013 5:13 PM, anydacdev anydacdev wrote: I am struggling with SQLite's support for Oracle's DUAL table. The updated statement, now including Oracle's DUAL looks like. MERGE INTO x TGT USING (SELECT 'A_NAME' as name, 'A_KEY' as key FROM DUAL) SRC As far as I can tell, you are using

Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO

2013-02-26 Thread anydacdev anydacdev
Thanks Igor. Yes, my situation resembles the second case. The SQLite statement is (surprisingly) compact :). I am struggling with SQLite's support for Oracle's DUAL table. The updated statement, now including Oracle's DUAL looks like. MERGE INTO x TGT USING (SELECT 'A_NAME' as name, 'A_KEY' as

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Dan Kennedy
On 02/27/2013 12:49 AM, Greg Janée wrote: I've instrumented the SQLite source and have found that the error is occurring at the fcntl call near the end of function unixLock (in SQLite version 3.7.0.1, this is line 23592 of sqlite3.c). The relevant code snippet is below. fnctl is returning -1,

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Michael Black
This was covered a few days ago...the error handling is not thread safe apparently(why not???) so you need to wrap the call and error check with a mutex. int rc=SQLITE_OK; char *errmsg=NULL; sqlite3_mutex_enter(sqlite_db_mutex(db)); rc=sqlite3_blobopen(.); if(rc!=SQLITE_OK) {

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Simon Slavin
On 26 Feb 2013, at 5:49pm, Greg Janée wrote: > SQLite is being used from a multi-threaded application in my case, and I > don't know if it's a possibility that some other thread is overwriting errno. Yes it is. Change your threading mode and see whether you get a different

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Kevin Benson
On Tue, Feb 26, 2013 at 11:34 AM, Gilles Ganault wrote: > Next, just to check, I reinstalled a fresh Windows7 + VS Express 201 > to try the "Precompiled binaries no bundle" this time. > > Even with the VC++ 2012 runtime, it still complained about > "SQLite.Interop.dll :

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Dan Kennedy
On 02/27/2013 12:00 AM, Greg Janée wrote: errno=2 (ENOENT) What could not be existing? Strange. Could the value of errno have been clobbered before you read it? What can you see if you run the app under "truss -tfcntl"? Dan. On Feb 26, 2013, at 4:01 AM, Dan Kennedy wrote: On 02/26/2013

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Greg Janée
errno=2 (ENOENT) What could not be existing? On Feb 26, 2013, at 4:01 AM, Dan Kennedy wrote: On 02/26/2013 05:22 AM, Greg Janée wrote: I'm accessing an SQLite database from two processes simultaneously. If there's contention, one process will receive an SQLITE_BUSY; that's fine. However,

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Gilles Ganault
Next, just to check, I reinstalled a fresh Windows7 + VS Express 201 to try the "Precompiled binaries no bundle" this time. Even with the VC++ 2012 runtime, it still complained about "SQLite.Interop.dll : The specified module could not be found". Turns out the wiki is half-wrong: When using the

Re: [sqlite] like query

2013-02-26 Thread Jay A. Kreibich
On Tue, Feb 26, 2013 at 12:34:03PM +, Simon Slavin scratched on the wall: > On 26 Feb 2013, at 7:39am, dd wrote: > > This database has unicode strings(chinese/japanese/...etc strings). can > > you tell me which is the correct character to replace with z? > > Ah.

Re: [sqlite] like query

2013-02-26 Thread Igor Tandetnik
On 2/26/2013 9:25 AM, dd wrote: Igor/Clemen Ladisch, SELECT * FROM emp WHERE column_test BETWEEN "somedata/" AND "somedata/z" I want to replace z with 10 character. But, it's failed. Failed in what way? How do you run your query? Show your code. -- Igor Tandetnik

Re: [sqlite] like query

2013-02-26 Thread Igor Tandetnik
On 2/26/2013 9:18 AM, dd wrote: 10 decimal value is 1114111. But, some chinese characters are greater than this value. You are mistaken. There are no Unicode characters above U+10, whether Chinese or otherwise. -- Igor Tandetnik ___

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Gilles Ganault
On Tue, 26 Feb 2013 15:28:13 +0100, Gilles Ganault wrote: >but it fails on the second line with "Type SQLiteCommand is not >defined". Is there another component I need to install? Got it: It just needs the following line at the top of the file: Imports System.Data.SQLite

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Gilles Ganault
After installing "Visual Studio Express 2012 for Windows Desktop", I downloaded and ran "Setups for 32-bit Windows (.Net Framework 4.5) bundle 1.0.84.0". I left the default option checked "Generate native images for the assemblies and install the images in the native image cache", and didn't

Re: [sqlite] like query

2013-02-26 Thread dd
Igor/Clemen Ladisch, >>SELECT * FROM emp WHERE column_test BETWEEN "somedata/" AND "somedata/z" I want to replace z with 10 character. But, it's failed. what is the correct decimal value for that? On Tue, Feb 26, 2013 at 6:18 PM, dd wrote: > 10 decimal value is

Re: [sqlite] like query

2013-02-26 Thread dd
10 decimal value is 1114111. But, some chinese characters are greater than this value. Is it correct character(10) to replace with z? Please correct me if I am doing wrong. On Tue, Feb 26, 2013 at 5:58 PM, Igor Tandetnik wrote: > On 2/26/2013 8:31 AM, Clemens

Re: [sqlite] Memory DB - Query does not return all records after Update

2013-02-26 Thread Marc L. Allen
Are you finalizing the UPDATE statement? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of mike.akers Sent: Monday, February 25, 2013 4:48 PM To: sqlite-users@sqlite.org Subject: [sqlite] Memory DB - Query does not return all

[sqlite] Memory DB - Query does not return all records after Update

2013-02-26 Thread mike.akers
I am using an in-memory database with a singleton containing a single connection. I have multiple threads (3) using this same connection, but I have ensured that only 1 thread uses the connection at a time. If I do an UPDATE on a record then immediately preform a SELECT, the query will return all

Re: [sqlite] like query

2013-02-26 Thread Igor Tandetnik
On 2/26/2013 8:31 AM, Clemens Ladisch wrote: Igor Tandetnik wrote:> On 2/26/2013 2:39 AM, dd wrote: SELECT * FROM emp WHERE column_test BETWEEN "somedata/" AND "somedata/zzz" This database has unicode strings(chinese/japanese/...etc strings). can you tell me which is the correct character to

Re: [sqlite] like query

2013-02-26 Thread Clemens Ladisch
Igor Tandetnik wrote:> On 2/26/2013 2:39 AM, dd wrote: >> SELECT * FROM emp WHERE column_test BETWEEN "somedata/" AND "somedata/zzz" >> >> This database has unicode strings(chinese/japanese/...etc strings). can >> you tell me which is the correct character to replace with z? > > U+, of course.

Re: [sqlite] sqlite3 last insert rowid

2013-02-26 Thread Igor Tandetnik
On 2/26/2013 4:16 AM, Ashok Pitambar wrote: Is there any way to primary key(composite key) just after insert using sqlite API? You have just specified it in the INSERT statement. Surely you know which value you've inserted - why do you need SQLite to tell you that? The reason

Re: [sqlite] like query

2013-02-26 Thread Igor Tandetnik
On 2/26/2013 2:39 AM, dd wrote: >>SELECT * FROM emp WHERE column_test BETWEEN "somedata/" AND "somedata/zzz" This database has unicode strings(chinese/japanese/...etc strings). can you tell me which is the correct character to replace with z? U+, of course. -- Igor Tandetnik

Re: [sqlite] like query

2013-02-26 Thread Simon Slavin
On 26 Feb 2013, at 7:39am, dd wrote: >>> SELECT * FROM emp WHERE column_test BETWEEN "somedata/" AND >>> "somedata/zzz" > > This database has unicode strings(chinese/japanese/...etc strings). can > you tell me which is the correct character to replace with z? Ah.

Re: [sqlite] locked database returning SQLITE_IOERR, not SQLITE_BUSY

2013-02-26 Thread Dan Kennedy
On 02/26/2013 05:22 AM, Greg Janée wrote: I'm accessing an SQLite database from two processes simultaneously. If there's contention, one process will receive an SQLITE_BUSY; that's fine. However, occasionally a process will receive an SQLITE_IOERR with the extended result code

Re: [sqlite] sqlite3 last insert rowid

2013-02-26 Thread Hick Gunter
You can always SELECT FROM WHERE ROWID= in case you have forgotten the values of the fields just inserted. Regards Gunter -Ursprüngliche Nachricht- Von: Ashok Pitambar [mailto:ashokpitam...@gmail.com] Gesendet: Dienstag, 26. Februar 2013 10:16 An: General Discussion of SQLite

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Gilles Ganault
On Tue, 26 Feb 2013 04:08:26 -0500, Kevin Benson wrote: >*(8) How do I install System.Data.SQLite on a development machine?* Thanks, but I still want to understand what the difference is between all the options in the Downloads page >Strictly speaking, there is no need

Re: [sqlite] sqlite3 last insert rowid

2013-02-26 Thread Ashok Pitambar
Thanks Hick, Is there any way to primary key(composite key) just after insert using sqlite API? On Tue, Feb 26, 2013 at 1:26 PM, Hick Gunter wrote: > No. It returns the value of the (hidden) column rowid. > > -Ursprüngliche Nachricht- > Von: Ashok Pitambar

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Kevin Benson
On Tue, Feb 26, 2013 at 3:43 AM, Gilles Ganault wrote: > I'll uninstall the one from Phoenix Software Solutions, but I'm > puzzled at which package to install from here: > > http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki >

Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?

2013-02-26 Thread Gilles Ganault
On Mon, 25 Feb 2013 22:32:26 +, Simon Slavin wrote: >There is no particular version of SQLite installed on your computer, and you >don't have to worry about downloading the latest version of SQLite. I installed it to use SQLite with VB.Net, and would like to upgrade to