Hi All, I am trying to execute MS DOS batch file from C# code using
system.diagnostics to run a sequence of sqlite3 commands to output query
results in a '.csv' file.

MyBatch.bat contains...

sqlite3 mydb.db < a.txt
echo "test" > c:\test.txt

a.txt contains...

.mode csv
.separator ,
.output c:\out.csv
select * from data limit 10;
.exit

my C# code...

using System.Diagnostics;

void test()
{
    Process.Start(@"C:\MyBatch.bat");
}

I have found that the above codes did not produce the 'c:\out.csv' at all
but the 'echo "test" > c:\test.txt' command produced the file 'c:\test.txt'
containing "test". There was no error message, there was only a command
prompt window flashing for a second. Also, I modified MyBatch.bat to change
the DOS input redirection into 'sqlite3 mydb.db ".read a.txt"' but still
did not work as expected.

What I tried that seemed to work were...

1. Double-click the unmodified 'c:\MyBatch.bat' file returned the expected
file 'c:\out.csv' containing the query results as  well as the
'c:\test.txt'.

2. Using the C# code below:

    private void test2()
        {
            string target =  @"c:\sqlite3";
            string arg1 = @"c:\\mydb.db";
            string arg2 = ".read " + @"c:\\a.sql";
            using (Process proc = new Process())
            {
                proc.StartInfo.FileName = target;
                proc.StartInfo.Arguments = string.Format("{0} \"{1}\"",
arg1, arg2);
                proc.StartInfo.RedirectStandardError = true;
                proc.StartInfo.RedirectStandardOutput = true;
                proc.StartInfo.UseShellExecute = false;
                proc.Start();

                proc.WaitForExit();
                textBox1.Text = proc.StandardError.ReadToEnd();
                proc.WaitForExit();
                textBox2.Text = proc.StandardOutput.ReadToEnd();
                proc.WaitForExit();
            }
        }


    where 'c:\a.sql' contains...
    select * from data limit 10;

    finally, would fill the textBox2.Text with the query results.


However, I need to be able to execute a batch file from my C# code to run a
series of sqlite3 commands to yield query results in .csv file. So, if
someone from this forum could help me, I would really appreciate it. Thank
you in advance.

Cheers,
Rick



On Thu, Feb 28, 2013 at 1:00 AM, <sqlite-users-requ...@sqlite.org> wrote:

> Send sqlite-users mailing list submissions to
>         sqlite-users@sqlite.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> or, via email, send a message with subject or body 'help' to
>         sqlite-users-requ...@sqlite.org
>
> You can reach the person managing the list at
>         sqlite-users-ow...@sqlite.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sqlite-users digest..."
>
>
> Today's Topics:
>
>    1. Re: locked database returning SQLITE_IOERR, not SQLITE_BUSY
>       (Greg Jan?e)
>    2. Re: locked database returning SQLITE_IOERR, not SQLITE_BUSY
>       (Dan Kennedy)
>    3. Re: locked database returning SQLITE_IOERR, not SQLITE_BUSY
>       (Greg Jan?e)
>    4. Re: [SQLite.ADO.Net] Upgrading XP to SQLite version?
>       (Kevin Benson)
>    5. Re: locked database returning SQLITE_IOERR, not SQLITE_BUSY
>       (Simon Slavin)
>    6. Re: locked database returning SQLITE_IOERR, not SQLITE_BUSY
>       (Michael Black)
>    7. Re: locked database returning SQLITE_IOERR, not SQLITE_BUSY
>       (Dan Kennedy)
>    8. Re: SQLite equivalent to Oracle's MERGE INTO (anydacdev anydacdev)
>    9. Re: SQLite equivalent to Oracle's MERGE INTO (Igor Tandetnik)
>   10. Re: [SQLite.ADO.Net] Upgrading XP to SQLite version?
>       (Gilles Ganault)
>   11. Re: [SQLite.ADO.Net] Upgrading XP to SQLite version?
>       (Kevin Benson)
>   12. Re: [SQLite.ADO.Net] Upgrading XP to SQLite version?
>       (Gilles Ganault)
>   13. Re: [SQLite.ADO.Net] Upgrading XP to SQLite version?
>       (Kevin Benson)
>   14. Re: Memory DB - Query does not return all records after
>       Update (Pavel Ivanov)
>   15. Re: SQLite equivalent to Oracle's MERGE INTO (Pavel Ivanov)
>   16. SQLite4 UPDATE performance (Rob Turpin)
>   17. Re: like query (Dominique Devienne)
>   18. Re: like query (Clemens Ladisch)
>   19. Re: like query (Dominique Devienne)
>   20. Re: SQLite4 UPDATE performance (Richard Hipp)
>   21. Re: SQLite equivalent to Oracle's MERGE INTO (James K. Lowden)
>   22. Re: like query (Igor Tandetnik)
>   23. Re: [SQLite.ADO.Net] Upgrading XP to SQLite version?
>       (Gilles Ganault)
>   24. SQLite2010 Pro ODBC Driver (Paul Mathieu)
>   25. Re: like query (Dominique Devienne)
>   26. Re: Memory DB - Query does not return all records after
>       Update (mike.akers)
>   27. Sqlite on windows ce 5.0 Emulator (Anand Shah)
>   28. Re: Memory DB - Query does not return all records after
>       Update (mike.akers)
>   29. Tool to import tables and its data from sqlserver to sqlite (levi)
>   30. Re: SQLite4 UPDATE performance (Rob Turpin)
>   31. Re: locked database returning SQLITE_IOERR, not SQLITE_BUSY
>       (Greg Jan?e)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 26 Feb 2013 09:00:41 -0800
> From: Greg Jan?e <gja...@ucop.edu>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
>         SQLITE_BUSY
> Message-ID: <89c55560-a936-48ee-8ffd-39fadc2b5...@ucop.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
>
> 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, occasionally a process will receive an SQLITE_IOERR
> >> with
> >> the extended result code SQLITE_IOERR_LOCK.  This seems to occur if
> >> the
> >> other process is in the middle of committing (at least, that's the
> >> only
> >> time I've been able to observe it).  Is this reasonable behavior?
> >> I was
> >> expecting to get SQLITE_BUSY and nothing else.  (SQLite 3.7.0.1 on
> >> Solaris 10; database on local filesystem.)
> >>
> >> Here's a log showing the serial actions of two processes, 9157 and
> >> 9096:
> >>
> >> 9157: opening cursor
> >> 9157: got cursor
> >> 9157: issuing begin immediate
> >> 9157: begun
> >> 9157: issuing delete
> >> 9157: deleted
> >> 9157: issuing commit
> >> 9096: opening cursor
> >> 9096: got cursor
> >> 9096: issuing begin immediate
> >> 9096: exception: IOError: disk I/O error, errcode=10, extended=3850
> >> 9096: closing cursor
> >> 9096: closed
> >> 9157: committed
> >> 9157: closing cursor
> >> 9157: closed
> >
> > What is errno set to after the error occurs?
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 27 Feb 2013 00:13:34 +0700
> From: Dan Kennedy <danielk1...@gmail.com>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
>         SQLITE_BUSY
> Message-ID: <512ced3e.9070...@gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> 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 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 SQLITE_IOERR_LOCK.  This seems to occur if the
> >>> other process is in the middle of committing (at least, that's the only
> >>> time I've been able to observe it).  Is this reasonable behavior?  I
> was
> >>> expecting to get SQLITE_BUSY and nothing else.  (SQLite 3.7.0.1 on
> >>> Solaris 10; database on local filesystem.)
> >>>
> >>> Here's a log showing the serial actions of two processes, 9157 and
> 9096:
> >>>
> >>> 9157: opening cursor
> >>> 9157: got cursor
> >>> 9157: issuing begin immediate
> >>> 9157: begun
> >>> 9157: issuing delete
> >>> 9157: deleted
> >>> 9157: issuing commit
> >>> 9096: opening cursor
> >>> 9096: got cursor
> >>> 9096: issuing begin immediate
> >>> 9096: exception: IOError: disk I/O error, errcode=10, extended=3850
> >>> 9096: closing cursor
> >>> 9096: closed
> >>> 9157: committed
> >>> 9157: closing cursor
> >>> 9157: closed
> >>
> >> What is errno set to after the error occurs?
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 26 Feb 2013 09:49:46 -0800
> From: Greg Jan?e <gja...@ucop.edu>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
>         SQLITE_BUSY
> Message-ID: <33da731e-336c-4d62-8788-683f77ab9...@ucop.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
>
> 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, and errno=2
> (ENOENT).  From my reading of the fcntl man page, it wouldn't seem to
> be possible for fcntl to even return ENOENT.
>
> 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.  But then, if that's even a possibility, wouldn't
> that seem to preclude using SQLite in a multithreaded application at
> all?
>
>    }else{
>      /* The request was for a RESERVED or EXCLUSIVE lock.  It is
>      ** assumed that there is a SHARED or greater lock on the file
>      ** already.
>      */
>      assert( 0!=pFile->eFileLock );
>      lock.l_type = F_WRLCK;
>      switch( eFileLock ){
>        case RESERVED_LOCK:
>          lock.l_start = RESERVED_BYTE;
>          break;
>        case EXCLUSIVE_LOCK:
>          lock.l_start = SHARED_FIRST;
>          lock.l_len = SHARED_SIZE;
>          break;
>        default:
>          assert(0);
>      }
>      s = fcntl(pFile->h, F_SETLK, &lock);
>      if( s==(-1) ){
>        tErrno = errno;
>        rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK);
>        if( IS_LOCK_ERROR(rc) ){
>          pFile->lastErrno = tErrno;
>        }
>      }
>    }
>
> On Feb 26, 2013, at 9:13 AM, Dan Kennedy wrote:
>
> > 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"?
>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 26 Feb 2013 13:09:10 -0500
> From: Kevin Benson <kevin.m.ben...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?
> Message-ID:
>         <
> cajy0h6g_axxzzlybwjcun7+ctwvny1ksumstqhjja_vq2v1...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, Feb 26, 2013 at 11:34 AM, Gilles Ganault <gilles.gana...@free.fr
> >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 : The specified module could not be found".
> >
> > Turns out the wiki is half-wrong: When using the "no bundle" package,
> > instead of using some "Externals" sub-directory,  it must be unpacked
> > in either the Debug\Release directory or some location that's part of
> > the PATH.
>
>
> 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 to the
> programmer.
>
> http://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.110).aspx
>
> You most likely would be fine with using the privatePath attribute of the
> <probing> <http://msdn.microsoft.com/en-us/library/823z9h8w.aspx> element:
>
> http://msdn.microsoft.com/en-us/library/823z9h8w.aspx
>
> in your app.config file in the <configuration section>
>
>
> Cheers,
> --
>    --
>       --
>          --???--
>         K e V i N
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 26 Feb 2013 18:13:29 +0000
> From: Simon Slavin <slav...@bigfraud.org>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
>         SQLITE_BUSY
> Message-ID: <246a98c8-77a0-4593-8c41-f6e3e59d2...@bigfraud.org>
> Content-Type: text/plain; charset=iso-8859-1
>
>
> On 26 Feb 2013, at 5:49pm, Greg Jan?e <gja...@ucop.edu> 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
> error, or if the error happens more or less often.
>
> Simon.
>
> ------------------------------
>
> Message: 6
> Date: Tue, 26 Feb 2013 12:18:50 -0600
> From: "Michael Black" <mdblac...@yahoo.com>
> To: "'General Discussion of SQLite Database'"
>         <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
>         SQLITE_BUSY
> Message-ID: <005601ce144d$ba9669a0$2fc33ce0$@com>
> Content-Type: text/plain;       charset="iso-8859-1"
>
> 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) {
>      rc=sqlite3_extended_errcode(db);
>      errmsg=strdup(sqlite3_errmsg(db);
>   }
>   sqlite3_mutex_leave(sqlite_db_mutex(db));
>   // now you can safely use rc and errmsg
>
> -----Original Message-----
> From: sqlite-users-boun...@sqlite.org
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Greg Jan?e
> Sent: Tuesday, February 26, 2013 11:50 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
> SQLITE_BUSY
>
> 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, and errno=2
> (ENOENT).  From my reading of the fcntl man page, it wouldn't seem to
> be possible for fcntl to even return ENOENT.
>
> 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.  But then, if that's even a possibility, wouldn't
> that seem to preclude using SQLite in a multithreaded application at
> all?
>
>    }else{
>      /* The request was for a RESERVED or EXCLUSIVE lock.  It is
>      ** assumed that there is a SHARED or greater lock on the file
>      ** already.
>      */
>      assert( 0!=pFile->eFileLock );
>      lock.l_type = F_WRLCK;
>      switch( eFileLock ){
>        case RESERVED_LOCK:
>          lock.l_start = RESERVED_BYTE;
>          break;
>        case EXCLUSIVE_LOCK:
>          lock.l_start = SHARED_FIRST;
>          lock.l_len = SHARED_SIZE;
>          break;
>        default:
>          assert(0);
>      }
>      s = fcntl(pFile->h, F_SETLK, &lock);
>      if( s==(-1) ){
>        tErrno = errno;
>        rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK);
>        if( IS_LOCK_ERROR(rc) ){
>          pFile->lastErrno = tErrno;
>        }
>      }
>    }
>
> On Feb 26, 2013, at 9:13 AM, Dan Kennedy wrote:
>
> > 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"?
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> ------------------------------
>
> Message: 7
> Date: Wed, 27 Feb 2013 01:32:37 +0700
> From: Dan Kennedy <danielk1...@gmail.com>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
>         SQLITE_BUSY
> Message-ID: <512cffc5.4010...@gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> 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, and errno=2 (ENOENT).  From my
> > reading of the fcntl man page, it wouldn't seem to be possible for fcntl
> > to even return ENOENT.
> >
> > 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.  But then, if that's even a possibility, wouldn't that seem to
> > preclude using SQLite in a multithreaded application at all?
>
> I think errno is thread specific on any unix that isn't ancient.
> On Solaris you have to get the compiler flags right - "-D_REENTRANT"
> or something. Maybe "-mt" too.
>
> I thought you might have been reading errno fter the sqlite3_step()
> call returned.
>
> It is weird that it is setting errno to ENOENT...
>
>
>
> ------------------------------
>
> Message: 8
> Date: Tue, 26 Feb 2013 23:13:15 +0100
> From: anydacdev anydacdev <anydac...@gmail.com>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO
> Message-ID:
>         <CAPrbC+1R9H_ioEakcpewb-hJYh-uA3YHMNjqwNXdKXopmYOL=
> a...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> 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 key FROM DUAL) SRC
> ON (TGT.key = SRC.key)
> WHEN MATCHED THEN
>    UPDATE SET TGT.NAME = NAME
> WHEN NOT MATCHED THEN
>    INSERT (TGT.NAME) VALUES (SRC.NAME)
>
> It would be great to know if SQLite has support for this.  Otherwise would
> are my options?
>
> Thanks.
>
>
> 2013/2/26 anydacdev anydacdev <anydac...@gmail.com>
>
> >
> >
> > ---------- Forwarded message ----------
> > From: anydacdev anydacdev <anydac...@gmail.com>
> > Date: 2013/2/26
> > Subject: Fwd: [sqlite] SQLite equivalent to Oracle's MERGE INTO
> > To: ronanvanr...@ymail.com
> >
> >
> >
> >
> > ---------- Forwarded message ----------
> > From: Igor Tandetnik <i...@tandetnik.org>
> > Date: 2013/2/26
> > Subject: Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO
> > To: sqlite-users@sqlite.org
> >
> >
> > On 2/25/2013 5:54 PM, anydacdev anydacdev wrote:
> >
> >> I was wondering what is SQLite's equivalent to:
> >>
> >> MERGE INTO x TGT
> >> USING (SELECT NAME, KEY FROM y) SRC
> >> ON (TGT.key = SRC.key)
> >> WHEN MATCHED THEN
> >>    UPDATE SET TGT.NAME = NAME
> >> WHEN NOT MATCHED THEN
> >>    INSERT (TGT.NAME) VALUES (SRC.NAME)
> >>
> >
> > If x.key happens to be unique (through PRIMARY KEY or UNIQUE constraint,
> > or a UNIQUE index), then you can do INSERT OR REPLACE (
> > http://sqlite.org/lang_**conflict.html<
> http://sqlite.org/lang_conflict.html>
> > )
> >
> > insert or replace into x(name, key)
> > select name, key from y;
> >
> > If x has other fields besides name and key, and you want to preserve them
> > on update path, then it becomes a bit trickier:
> >
> > insert or replace into x(name, key, otherField)
> > select name, key, otherField from y left join x on (y.key = x.key);
> >
> > If x.key is not unique, then there's nothing better in SQLite than
> running
> > INSERT and UPDATE statements separately.
> > --
> > Igor Tandetnik
> >
> > ______________________________**_________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>
> >
> >
> >
>
>
> ------------------------------
>
> Message: 9
> Date: Tue, 26 Feb 2013 17:29:14 -0500
> From: Igor Tandetnik <i...@tandetnik.org>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO
> Message-ID: <kgjcvm$lt$1...@ger.gmane.org>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> 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 DUAL as a table with no data, just
> something to put into a FROM clause to keep the parser happy. In this
> case, you would be glad to know that SQLite doesn't require FROM clause
> at all - you can simply write
>
> SELECT 'A_NAME' as name, 'A_KEY' as key
>
> --
> Igor Tandetnik
>
>
>
> ------------------------------
>
> Message: 10
> Date: Tue, 26 Feb 2013 23:37:25 +0100
> From: Gilles Ganault <gilles.gana...@free.fr>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?
> Message-ID: <rrdqi89g7t209ug4paoomvrlre9it0c...@4ax.com>
> Content-Type: text/plain; charset=us-ascii
>
> 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 attempts to offer a general
> >advisement about the "Externals" folder as a *HINT*. The rest is up to the
> >programmer.
>
> Thanks for the link to MSDN, but it doesn't mention \Externals, so the
> application won't find the other DLL since it's neither in the
> application directory nor in the PATH.
>
> Unless there's a better way to install the contents of the non-bundle
> ZIP, I think the wiki should simply say that 1) it  contains two DLLs
> (the non-managed SQLite DLL, and a managed .Net wrapper), and the
> non-managed DLL must be located in a directory that the application
> can find.
>
> http://msdn.microsoft.com/en-us/library/823z9h8w.aspx
> >in your app.config file in the <configuration section>
>
> I'll check it out.
>
> Thank you.
>
>
>
> ------------------------------
>
> Message: 11
> Date: Tue, 26 Feb 2013 18:44:28 -0500
> From: Kevin Benson <kevin.m.ben...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?
> Message-ID:
>         <CAJy0h6hv6+zU0iyBA=
> v1k8_7dgz0f7e60sz5+xy_5oovuqa...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, Feb 26, 2013 at 5:37 PM, Gilles Ganault <gilles.gana...@free.fr
> >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 attempts to offer a
> general
> > > advisement about the "Externals" folder as a *HINT*. The rest is up to
> > the
> > > programmer.
> >
> > Thanks for the link to MSDN, but it doesn't mention \Externals, so the
> > application won't find the other DLL since it's neither in the
> > application directory nor in the PATH.
> >
>
>
> The directory doesn't *HAVE* to be called ...\Externals. You pick the name,
> any name, and then tell Visual Studio, that is all ;-)
> The FAQ is just illustrating with a "semantic" name example ...that the
> folder(s) would represent "where you store" any/all external files
> associated with your project/solution. I ~believe~ the histrionics of
> Visual Studio C++ discussions reference /Externals, so that example
> name likely originates somewhere back in time and actual usage.
> --
>    --
>       --
>          --???--
>         K e V i N
>
>
> ------------------------------
>
> Message: 12
> Date: Wed, 27 Feb 2013 01:00:20 +0100
> From: Gilles Ganault <gilles.gana...@free.fr>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?
> Message-ID: <qviqi815kpsogsacp0m2j80ne6vg4vs...@4ax.com>
> Content-Type: text/plain; charset=us-ascii
>
> On Tue, 26 Feb 2013 18:44:28 -0500, Kevin Benson
> <kevin.m.ben...@gmail.com> 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 (Project > Add Reference), the wiki doesn't say that this
> doesn't take care of the other DLL.
>
> Speaking of which, why is the no-bundle version (two DLLs) to be
> prefered to the bundle version (single DLL)? It solves this issue.
>
>
>
> ------------------------------
>
> Message: 13
> Date: Tue, 26 Feb 2013 19:45:27 -0500
> From: Kevin Benson <kevin.m.ben...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?
> Message-ID:
>         <CAJy0h6gsHYG+9JShXGjyh-neorXTuFKzJp=
> u0wopxt3q-tr...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, Feb 26, 2013 at 7:00 PM, Gilles Ganault <gilles.gana...@free.fr
> >wrote:
>
> > On Tue, 26 Feb 2013 18:44:28 -0500, Kevin Benson
> > < kevin.m.ben...@gmail.com> 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 (Project > Add Reference), the wiki doesn't say that this
> > doesn't take care of the other DLL.
> >
> > Speaking of which, why is the no-bundle version (two DLLs) to be
> > prefered to the bundle version (single DLL)? It solves this issue.
>
>
> http://www.mail-archive.com/sqlite-users@sqlite.org/msg73039.html
>
> --
>    --
>       --
>          --???--
>         K e V i N
>
>
> ------------------------------
>
> Message: 14
> Date: Tue, 26 Feb 2013 21:03:35 -0800
> From: Pavel Ivanov <paiva...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] Memory DB - Query does not return all records
>         after   Update
> Message-ID:
>         <
> cag1a4rs8+uh9pw6hukxfhxze7h7h5+wg5gp4gxzfnlm6egk...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> > 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 order? And tell us how their
> results are different from what you expect.
>
>
> Pavel
>
>
> On Mon, Feb 25, 2013 at 1:47 PM, mike.akers <mike.aker...@gmail.com>
> wrote:
> > 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 rows that match the WHERE clause except for the record
> that
> > was being updated. The sqlite3_prepare_v2 and sqlite3_step both return
> > SQLITE_OK and do not return a SQLITE_LOCKED or SQLITE_BUSY so I would
> assume
> > that my write was completed.
> >
> > I would like to be able to either
> > 1. read the old data (as the quieres happen frequently a couple old data
> > queries are fine) I have tried read_uncommited with no noticable
> difference.
> > or 2. Have the database return LOCKED or BUSY if the write has not
> completed
> > so that the query will return all of the results.
> >
> > 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, ....
> >
> > Any advice on what I am missing?
> >
> > Thanks in advance,
> > Mike
> >
> >
> >
> > --
> > View this message in context:
> http://sqlite.1065341.n5.nabble.com/Memory-DB-Query-does-not-return-all-records-after-Update-tp67267.html
> > Sent from the SQLite mailing list archive at Nabble.com.
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> ------------------------------
>
> Message: 15
> Date: Tue, 26 Feb 2013 21:13:38 -0800
> From: Pavel Ivanov <paiva...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO
> Message-ID:
>         <
> cag1a4rutgj+bpvor2vgdfadjteexsc2a+vojrvw4edw8nxj...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Tue, Feb 26, 2013 at 2:29 PM, Igor Tandetnik <i...@tandetnik.org>
> 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 (SELECT 'A_NAME' as name, 'A_KEY' as key FROM DUAL) SRC
> >
> >
> > As far as I can tell, you are using DUAL as a table with no data, just
>
> Igor, a little correction here: it's not table with no data, it's
> table with exactly one row. If it was table with no data then SELECT
> .. FROM DUAL would have returned nothing. ;-)
>
> But anyway you suggested the correct replacement for that in SQLite.
>
>
> Pavel
>
> > something to put into a FROM clause to keep the parser happy. In this
> case,
> > you would be glad to know that SQLite doesn't require FROM clause at all
> -
> > you can simply write
> >
> >
> > SELECT 'A_NAME' as name, 'A_KEY' as key
> >
> > --
> > Igor Tandetnik
> >
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> ------------------------------
>
> Message: 16
> Date: Wed, 27 Feb 2013 01:24:59 -0700
> From: Rob Turpin <flax3...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: [sqlite] SQLite4 UPDATE performance
> Message-ID:
>         <
> ca+owj8i-wvb_y5x6rnzuyrysngcbu+wqfj7zx9vsjj3hy_c...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I wrote up a test case to do some performance tests for the update
> statement, and I'd thought I'd ask before probing around the code first.
>
> I did some comparisons with SQLite3.
>
> The update statement is like this:
>
> update pk_sk set sk=? where pk=?
>
> pk being the primary key.
>
> Using the command line interpreter and running an explain query plan I get:
>
> SQLite3:
> 0|0|0|SEARCH TABLE pk_sk USING INTEGER PRIMARY KEY (rowid=?) (~1 rows)
>
> SQLite4:
> 0|0|0|SEARCH TABLE pk_sk USING PRIMARY KEY (pk=?) (~1 rows)
>
> Don't know if that provides anything, thought I'd send it.
>
> So a general synopsis of the tests.  I'm doing random updates when there
> are 100,000 rows in a table.
>
> For SQLite3 when using a DB on disk I'm getting around 41,000 updates per
> second
> For SQLite4 when using a DB on disk I'm getting around 9,200 updates per
> second
>
> For the moment I'm not too worried about this, but it's really weird when I
> run tests with an in memory DB
>
> For SQLite3: 280,000 updates per second
> For SQLite4: 290 updates per second
>
> So why the abysmal drop for the in memory SQLite4?  I'm assuming maybe some
> tracer/debug code I know nothing about.  Thought I'd ask about this before
> I started getting lost in rooting around code and debugging my two versions
> of tests looking for something.  If someone can give a little info. to give
> me a better focus on where to look, that would be great.
>
> Thanks,
> Rob
>
>
> ------------------------------
>
> Message: 17
> Date: Wed, 27 Feb 2013 10:35:40 +0100
> From: Dominique Devienne <ddevie...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] like query
> Message-ID:
>         <CAFCRh--nRZ_08_EFqF_SAe+EGwOQ7Udb57WCSr=
> ma+dx8n4...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Tue, Feb 26, 2013 at 2:31 PM, Clemens Ladisch <clem...@ladisch.de>
> wrote:
>
> >   ... 'somedata/' || CAST(x'F48FBFBF' AS TEXT)
> >
>
> Great trick! But it hardly qualifies as user friendly though, no?
>
> For our app, I added a chr() SQL function that take an arbitrary number of
> integers and UTF-8 encodes them:
>
>     register_function(-1, "chr", codepoint_to_utf8);
>
> so the above becomes
>
>     ... 'somedata/' || chr(1114111)
>
> Of course, the fact that it's a decimal code-point number is not ideal
> since less expressive than
>
>     ... 'somedata/' || chr(0x10FFFF)
>
> but hexa-literals are not supported in SQL it seems (I tried just SQLite
> and Oracle).
>
> My $0.02 is that such a chr() function could/should be built-in to SQLite.
> --DD
>
> PS: Something else that should also be part of SQLite built-in is the
> optimization that col LIKE 'prefix%' queries should implicitly try to use
> an index on col. I suspect it may be more difficult than I expect because
> of collation, but absent custom collations, I wish that optimization was
> available.
>
>
> ------------------------------
>
> Message: 18
> Date: Wed, 27 Feb 2013 11:23:03 +0100
> From: Clemens Ladisch <clem...@ladisch.de>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] like query
> Message-ID: <512dde87.2030...@ladisch.de>
> Content-Type: text/plain; charset=us-ascii
>
> Dominique Devienne wrote:
> > My $0.02 is that such a chr() function could/should be built-in to
> SQLite.
>
> Apparently, drh has a time machine:
> http://www.sqlite.org/cgi/src/info/209b21085b
>
>
> Regards,
> Clemens
>
>
> ------------------------------
>
> Message: 19
> Date: Wed, 27 Feb 2013 13:15:28 +0100
> From: Dominique Devienne <ddevie...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] like query
> Message-ID:
>         <
> cafcrh--ns5bsz+uwy2_p-arf+oq25ntpkafcm17+btoip4n...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Wed, Feb 27, 2013 at 11:23 AM, Clemens Ladisch <clem...@ladisch.de
> >wrote:
>
> > Dominique Devienne wrote:
> > > My $0.02 is that such a chr() function could/should be built-in to
> > SQLite.
> >
> > Apparently, drh has a time machine:
> > http://www.sqlite.org/cgi/src/info/209b21085b
> >
>
> Indeed! Spooky :) --DD
>
>
> ------------------------------
>
> Message: 20
> Date: Wed, 27 Feb 2013 07:47:26 -0500
> From: Richard Hipp <d...@sqlite.org>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] SQLite4 UPDATE performance
> Message-ID:
>         <CALwJ=My8MZdGZrxh9tMsw=mp9U8jEAp9=
> hi8+oxlz325jvj...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Wed, Feb 27, 2013 at 3:24 AM, Rob Turpin <flax3...@gmail.com> wrote:
>
> > I wrote up a test case to do some performance tests for the update
> > statement, and I'd thought I'd ask before probing around the code first.
> >
> > For SQLite3: 280,000 updates per second
> > For SQLite4: 290 updates per second
> >
> > So why the abysmal drop for the in memory SQLite4?
> >
>
> I ran this in the profiler and saw that the SQLite4 is spending 97.53% of
> its time (literally) in a single debugging check inside of the in-memory KV
> storage engine: assertUpPointer().  This routine is entirely option, of
> course, and is there merely to verify the integrity of the binary tree used
> for storage.  If you disable that one routine, the in-memory database is
> very fast, it seems.
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
>
>
> ------------------------------
>
> Message: 21
> Date: Wed, 27 Feb 2013 08:53:19 -0500
> From: "James K. Lowden" <jklow...@schemamania.org>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO
> Message-ID: <20130227085319.73a72746.jklow...@schemamania.org>
> Content-Type: text/plain; charset=US-ASCII
>
> On Mon, 25 Feb 2013 23:54:23 +0100
> anydacdev anydacdev <anydac...@gmail.com> wrote:
>
> > I was wondering what is SQLite's equivalent to:
> >
> > MERGE INTO x TGT
> > USING (SELECT NAME, KEY FROM y) SRC
> > ON (TGT.key = SRC.key)
> > WHEN MATCHED THEN
> >   UPDATE SET TGT.NAME = NAME
> > WHEN NOT MATCHED THEN
> >   INSERT (TGT.NAME) VALUES (SRC.NAME)
>
> begin transaction;
> update tgt
> set name = (select name from src where tgt.key = src.key)
> where exists (
>         select 1 from src
>         where src.key = tgt.key
> );
> -- check for error
> insert into tgt (name)
> select name from src
> where not exists (
>         select 1 from tgt
>         where tgt.key = src.key
> );
> -- check for error
> commit transaction;
>
> It's only close, not equivalent, because MERGE is atomic: here src and
> tgt could change between UPDATE and INSERT.  That you'll have to deal
> with using timestamps or some form of advisory locking.
>
> HTH.
>
> --jkl
>
>
> ------------------------------
>
> Message: 22
> Date: Wed, 27 Feb 2013 09:16:29 -0500
> From: Igor Tandetnik <i...@tandetnik.org>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] like query
> Message-ID: <kgl4fs$6lj$1...@ger.gmane.org>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> On 2/27/2013 4:35 AM, Dominique Devienne wrote:
> > PS: Something else that should also be part of SQLite built-in is the
> > optimization that col LIKE 'prefix%' queries should implicitly try to use
> > an index on col.
>
> http://www.sqlite.org/optoverview.html#like_opt
>
> --
> Igor Tandetnik
>
>
>
> ------------------------------
>
> Message: 23
> Date: Wed, 27 Feb 2013 15:28:24 +0100
> From: Gilles Ganault <gilles.gana...@free.fr>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] [SQLite.ADO.Net] Upgrading XP to SQLite version?
> Message-ID: <jdjri8h8ves73f7pkkukndbs720cilm...@4ax.com>
> Content-Type: text/plain; charset=us-ascii
>
> On Tue, 26 Feb 2013 19:45:27 -0500, Kevin Benson
> <kevin.m.ben...@gmail.com> wrote:
> >> Right, but while the first DLL will be found since it's now part of
> >> the project (Project > Add Reference), the wiki doesn't say that this
> >> doesn't take care of the other DLL.
>
> >http://www.mail-archive.com/sqlite-users@sqlite.org/msg73039.html
>
> Good to know, although creating an .\x86 or .\x64 doesn't seem to add
> anything as compared to simply putting the two DLLs in the
> application's directory.
>
> >> Speaking of which, why is the no-bundle version (two DLLs) to be
> >> prefered to the bundle version (single DLL)? It solves this issue.
>
> I still didn't find any info on the web about what the difference is.
>
> The wiki says: "All the "bundle" packages contain the
> "System.Data.SQLite.dll" mixed-mode assembly. These packages should
> only be used in cases where the assembly binary must be deployed to
> the Global Assembly Cache for some reason (e.g. to support some legacy
> application on customer machines). "
>
> Anyone knows more?
>
> Thank you.
>
>
>
> ------------------------------
>
> Message: 24
> Date: Wed, 27 Feb 2013 09:09:08 -0700
> From: "Paul Mathieu" <pmath...@intellimed.com>
> To: <sqlite-users@sqlite.org>
> Subject: [sqlite] SQLite2010 Pro ODBC Driver
> Message-ID: <002501ce1504$c6257880$52706980$@intellimed.com>
> Content-Type: text/plain;       charset="us-ascii"
>
> Good Morning,
>
> I am trying the SQLite2010 Pro ODBC Driver in a connection string in
> PowerBuilder 12.5. In the database painter and in a compiled app some
> selects from tables are returning more than what is in the table. The
> county
> table has 4280 records. Selecting specific columns or the whole table
> returns 831,911 records. The zip table has zip_code char(5) and county
> char(80) along with other columns.
>
> Select zip code from zip where state = 'AZ' returns  605 records which is
> correct.
>
> Select zip_code, county from zip where state = 'AZ' returns 82,011records.
>
> Select county from zip where state = 'AZ' returns 82,011records.
>
> Select Distinct does not change the result.
>
>
>
> The SQLite3 ODBC Driver does not have this issue.
>
> Thank you,
>
> Paul
>
>
>
>
>
> ------------------------------
>
> Message: 25
> Date: Wed, 27 Feb 2013 17:13:33 +0100
> From: Dominique Devienne <ddevie...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] like query
> Message-ID:
>         <CAFCRh--doMbxgCizK2TOww8-Uj=kkw7J8rSArqaMH=J4oRe=
> w...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Wed, Feb 27, 2013 at 3:16 PM, Igor Tandetnik <i...@tandetnik.org>
> wrote:
>
> > On 2/27/2013 4:35 AM, Dominique Devienne wrote:
> >
> >> PS: Something else that should also be part of SQLite built-in is the
> >> optimization that col LIKE 'prefix%' queries should implicitly try to
> use
> >> an index on col.
> >>
> >
> > http://www.sqlite.org/**optoverview.html#like_opt<
> http://www.sqlite.org/optoverview.html#like_opt>
>
>
> Thanks for the reminder. Note though that last time I checked [1], this
> didn't work for a multi-column index, even if the column involved in a
> prefix-based like-where-clause is first in the index. --DD
>
> [1]
>
> http://stackoverflow.com/questions/11152371/how-to-improve-the-performance-of-query-with-where-and-group-by-in-sqlite/11736532#11736532
>
>
> ------------------------------
>
> Message: 26
> Date: Tue, 26 Feb 2013 06:27:08 -0800 (PST)
> From: "mike.akers" <mike.aker...@gmail.com>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Memory DB - Query does not return all records
>         after   Update
> Message-ID: <1361888828583-67292.p...@n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Yes I believe so. For my UPDATES, currently (things have moved around
> quite a
> bit for me trying to solve this)
>
> sqlite3_exec(this->hDBC_, "BEGIN EXCLUSIVE TRANSACTION;", NULL, NULL, 0);
>
> sqlite3_prepare_v2(this->hDBC_, updateStatement, -1, &this->hStmt_, 0);
>
> sqlite3_bind_blob(this->hStmt_, 1, blob, blobSize, SQLITE_STATIC);
>
> sqlite3_step(this->hStmt_);
>
> sqlite3_exec(this->hDBC_, "END TRANSACTION;", NULL, NULL, 0);
>
> sqlite3_finalize(this->hStmt_);
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/Memory-DB-Query-does-not-return-all-records-after-Update-tp67267p67292.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 27
> Date: Tue, 26 Feb 2013 20:20:48 -0800 (PST)
> From: Anand Shah <anand_s...@cimcon.com>
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Sqlite on windows ce 5.0 Emulator
> Message-ID: <1361938847987-67313.p...@n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hello,
> I am able to run application successfully developed with vs2005 .net CF 2.0
> on my local windows embedded ce 6.0 machine. I am trying to deploy this
> application to windows emulator ce 5.0 as a device application and it also
> gets deployed successfully but when any event calls sqlite dll it is
> raising
> errors.
>
> I am using SQLite-1.0.66.0-binaries.
>
> Please advice.
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/Sqlite-on-windows-ce-5-0-Emulator-tp67313.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 28
> Date: Wed, 27 Feb 2013 04:22:26 -0800 (PST)
> From: "mike.akers" <mike.aker...@gmail.com>
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Memory DB - Query does not return all records
>         after   Update
> Message-ID: <1361967746833-67320.p...@n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> COT_EVENT_TABLE = "CREATE TABLE MAIN_TABLE(   pk char(41) primary key,\
>                                                                 item1 real,
> \
>                                                                 item2
> char(64),                   \
>                                                                 item3
> timestamp,              \
>                                                                 item4
> integer,                \
>                                                                 item5
> TIMESTAMP NOT NULL DEFAULT current_timestamp, \
>                                                                 Blob
> char(1024))";
>
> Lets assume I have inserted 10 records. pk = 1 - 10
>
> sqlite3_exec(this->hDBC_, "BEGIN EXCLUSIVE TRANSACTION;", NULL, NULL, 0);
> sqlite3_prepare_v2(this->hDBC_, "SELECT * FROM MAIN_TABLE", -1,
> &this->hStmt_, 0);
> sqlite3_step(this->hStmt_);
> sqlite3_exec(this->hDBC_, "END TRANSACTION;", NULL, NULL, 0);
> sqlite3_finalize(this->hStmt_);
>     Expect 10 Results -- Returns 10 Results
> This Select statement is on a loop of roughly .5s
> ...
>
> Then on an external event, another thread will aquire my mutex and attempt
> an update
> sqlite3_exec(this->hDBC_, "BEGIN EXCLUSIVE TRANSACTION;", NULL, NULL, 0);
> sqlite3_prepare_v2(this->hDBC_, "UPDATE EVENT_TABLE SET item1 = value1,
> item2 = value2, blob = ?, WHERE pk = 5", -1, &this->hStmt_, 0);
> sqlite3_bind_blob(this->hStmt_, 1, blob, blobSize, SQLITE_STATIC);
> sqlite3_step(this->hStmt_);
> sqlite3_exec(this->hDBC_, "END TRANSACTION;", NULL, NULL, 0);
> sqlite3_finalize(this->hStmt_);
>   Expect SQLITE_OK -- Returns SQLITE_OK
>
> Now, if a select statments timer is up immediately after this update,
> meaning the next thing the thread does it the first set of statements. Then
> sqlite3_exec returns SQLITE_OK and there are 9 results (pk = 5 is missing).
> I expect either 10 results, or for sqlite3_exec to return a SQLITE_LOCKED,
> BUSY, or something other than _OK.
>
> Additional Info
> SQLITE_VERSION "3.7.14.1"
> To open my connection:
> sqlite3_config(SQLITE_CONFIG_URI);
> sqlite3_enable_shared_cache(true);
> sqlite3_open("file::memory:?cache=shared", &hDBC_);
> sqlite3_extended_result_codes(hDBC_, true);
> I did not change SQLITE_THREADSAFE so I assuming it is still the default
> "1"
>
>
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/Memory-DB-Query-does-not-return-all-records-after-Update-tp67267p67320.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 29
> Date: Wed, 27 Feb 2013 07:10:53 -0800 (PST)
> From: levi <levi.silva.men...@gmail.com>
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Tool to import tables and its data from sqlserver to
>         sqlite
> Message-ID: <1361977853558-67325.p...@n5.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hello everyone,
>
> I have one Android App that will use the sqlite database, I would to do the
> following:
>
> I want to create the sqlite database, from sqlserver database, and download
> it sqlite database that I created from the SqlServer to my Android App
> Are there any tool to import the tables and its data from sqlserver
> database
> to the sqlite database?
>
> More precisely, I want to create a sqlite database based on a few tables
> and
> data from the Sqlserver database.
>
> Thanks in advanced.
>
>
>
>
>
>
> --
> View this message in context:
> http://sqlite.1065341.n5.nabble.com/Tool-to-import-tables-and-its-data-from-sqlserver-to-sqlite-tp67325.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 30
> Date: Wed, 27 Feb 2013 09:54:31 -0700
> From: Rob Turpin <flax3...@gmail.com>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] SQLite4 UPDATE performance
> Message-ID:
>         <
> ca+owj8gz0at9ezu2zvyxz3kekisatnescyrmbvfwq8zwepd...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Richard,
>
> I commented out SQLITE4_DEBUG and SQLITE4_MEMDEBUG and added -DNDEBUG=1.
>
> That did the trick!  More like 224,000 updates per second.  Thanks for your
> help
>
> Rob
>
> On Wed, Feb 27, 2013 at 5:47 AM, Richard Hipp <d...@sqlite.org> wrote:
>
> > On Wed, Feb 27, 2013 at 3:24 AM, Rob Turpin <flax3...@gmail.com> wrote:
> >
> > > I wrote up a test case to do some performance tests for the update
> > > statement, and I'd thought I'd ask before probing around the code
> first.
> > >
> > > For SQLite3: 280,000 updates per second
> > > For SQLite4: 290 updates per second
> > >
> > > So why the abysmal drop for the in memory SQLite4?
> > >
> >
> > I ran this in the profiler and saw that the SQLite4 is spending 97.53% of
> > its time (literally) in a single debugging check inside of the in-memory
> KV
> > storage engine: assertUpPointer().  This routine is entirely option, of
> > course, and is there merely to verify the integrity of the binary tree
> used
> > for storage.  If you disable that one routine, the in-memory database is
> > very fast, it seems.
> >
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
> ------------------------------
>
> Message: 31
> Date: Wed, 27 Feb 2013 08:58:32 -0800
> From: Greg Jan?e <gja...@ucop.edu>
> To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
>         SQLITE_BUSY
> Message-ID: <e16bfade-ecee-4576-a512-cffc931aa...@ucop.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
>
> For the record, this problem went away when I upgraded to the latest &
> greatest (3.7.15.2).
>
> On Feb 27, 2013, at 8:57 AM, Greg Janee wrote:
>
> >
> > ________________________________________
> > From: sqlite-users-boun...@sqlite.org [sqlite-users-
> > boun...@sqlite.org] on behalf of Dan Kennedy [danielk1...@gmail.com]
> > Sent: Tuesday, February 26, 2013 10:32 AM
> > To: sqlite-users@sqlite.org
> > Subject: Re: [sqlite] locked database returning SQLITE_IOERR, not
> > SQLITE_BUSY
> >
> > 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, and errno=2 (ENOENT).
> >> From my
> >> reading of the fcntl man page, it wouldn't seem to be possible for
> >> fcntl
> >> to even return ENOENT.
> >>
> >> 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.  But then, if that's even a possibility, wouldn't that seem to
> >> preclude using SQLite in a multithreaded application at all?
> >
> > I think errno is thread specific on any unix that isn't ancient.
> > On Solaris you have to get the compiler flags right - "-D_REENTRANT"
> > or something. Maybe "-mt" too.
> >
> > I thought you might have been reading errno fter the sqlite3_step()
> > call returned.
> >
> > It is weird that it is setting errno to ENOENT...
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> ------------------------------
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> End of sqlite-users Digest, Vol 62, Issue 26
> ********************************************
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to