[sqlite] inner join

2007-07-16 Thread Andre du Plessis
I would like to be able to accomplish the following but don't see any support for inner joins on update queries. update A set Id = B.Id from A inner join B on A.Field1 = B.Field_Temp where B.Price > 0 Is this possible? What is the syntax of this query please?

Re: [sqlite] Get the data from previous months: please, help me to optimize the query...

2007-07-16 Thread Marco NOVARO
Dear both (Christian and Joe), (I'm the original author of the first mail, I'm just using my "usual" mail, now... :D ). Thanks for the replies: both works fine: I have no problem in adding new data to the DB, but the performance IS an issue. I tested your solutions, and I got the data in 200ms,

RE: [sqlite] Sharing an in-memory database between applications

2007-07-16 Thread Dennis Povshedny
Hi Rob! Maybe standard windows feature memory-mapping-file can help you? Regards Xeepe Phone Solution Team http://en.xeepe.com -Original Message- From: Rob Richardson [mailto:[EMAIL PROTECTED] Sent: Friday, July 13, 2007 7:35 PM To: sqlite-users@sqlite.org Subject: [sqlite] Sharing

[sqlite] Re: inner join

2007-07-16 Thread Igor Tandetnik
Andre du Plessis <[EMAIL PROTECTED]> wrote: I would like to be able to accomplish the following but don't see any support for inner joins on update queries. update A set Id = B.Id from A inner join B on A.Field1 = B.Field_Temp where B.Price > 0 update A set Id = coalesce( (select Id from B

RE: [sqlite] Re: inner join

2007-07-16 Thread RB Smissaert
That is an interesting one. Where could I find documentation about coalesce? RBS -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: 16 July 2007 12:49 To: SQLite Subject: [sqlite] Re: inner join Andre du Plessis <[EMAIL PROTECTED]> wrote: > I would like to be able

[sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-16 Thread Ahmed Sulaiman
Hi all, I have tried this question in the forum with no answer, so I decide to give it a try here :) I am using the "Using" statements in C# to handle the closing of SQLite connection, transaction and command objects. I have this setup in different places in my code (Generic methods returning

[sqlite] sqlite3

2007-07-16 Thread Huber Privat
Guten Tag Ich arbeite mit SQLite3 über ein Netzwerk. Wenn 2 User zur gleichen Zeit arbeiten wird der Zugriff auf die SQLite3-Datenbank sehr langsam. Was mache ich falsch. Bitte um Hilfe. mfg Huber Gerhard [EMAIL PROTECTED]

[sqlite] Can ORDER-BY perform Case-Insensitive comparison?

2007-07-16 Thread Bharath Booshan L
Hi All, Eg: People table | EmpID | Name| 21 Rajesh 22 raj 23 Rakesh 24 ramesh Consider following query SELECT Name FROM People ORDER BY Name ASC; will result as Rajesh Rakesh raj ramesh But where as I need the output to

RE: [sqlite] Re: inner join

2007-07-16 Thread Andre du Plessis
The Id piece works great thanks! If I want to update 2 fields on table A, the following syntax doesn't work as expected, as it updates all to records to 'DONE'. update A set Flag = 'DONE', Id = coalesce( (select Id from B where A.Field1 = B.Field_Temp and B.Price > 0), Id);

[sqlite] Re: Re: inner join

2007-07-16 Thread Igor Tandetnik
RB Smissaert <[EMAIL PROTECTED]> wrote: Where could I find documentation about coalesce? http://sqlite.org/lang_expr.html Near the bottom where all the built-in functions are described. Igor Tandetnik - To

Re: [sqlite] Re: inner join

2007-07-16 Thread Gerry Snyder
RB Smissaert wrote: That is an interesting one. Where could I find documentation about coalesce? The basic description is to be found in the Core Functions section of: http://sqlite.org/lang_expr.html In a nutshell, the function returns the first non-null argument. HTH, Gerry

Re: [sqlite] sqlite3

2007-07-16 Thread drh
Huber Privat <[EMAIL PROTECTED]> wrote: > Guten Tag > > Ich arbeite mit SQLite3 über ein Netzwerk. > > Wenn 2 User zur gleichen Zeit arbeiten wird der > Zugriff auf die SQLite3-Datenbank sehr langsam. > > Was mache ich falsch. > Bitte um Hilfe. > SQLite tends to not work well on a network

Re: [sqlite] Can ORDER-BY perform Case-Insensitive comparison?

2007-07-16 Thread drh
Bharath Booshan L <[EMAIL PROTECTED]> wrote: > > Consider following query > > SELECT Name > FROM People > ORDER BY Name ASC; > SELECT Name FROM People ORDER BY Name ASC COLLATE nocase; The nocase collating sequence only works for US-ASCII characters. If you need UTF-8 you will need

Re: [sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-16 Thread drh
"Ahmed Sulaiman" <[EMAIL PROTECTED]> wrote: > Hi all, > > I have tried this question in the forum with no answer, so I decide to > give it a try here :) > > I am using the "Using" statements in C# to handle the closing of SQLite > connection, transaction and command objects. I have this setup

[sqlite] Re: Re: inner join

2007-07-16 Thread Igor Tandetnik
Andre du Plessis <[EMAIL PROTECTED]> wrote: The Id piece works great thanks! If I want to update 2 fields on table A, the following syntax doesn't work as expected, as it updates all to records to 'DONE'. update A set Flag = 'DONE', Id = coalesce( (select Id from B where A.Field1 =

[sqlite] Re: Can ORDER-BY perform Case-Insensitive comparison?

2007-07-16 Thread Igor Tandetnik
Bharath Booshan L <[EMAIL PROTECTED]> wrote: Consider following query SELECT Name FROM People ORDER BY Name ASC; will result as Rajesh Rakesh raj ramesh But where as I need the output to be sorted alphabetically irrespective of its CASE as shown below. ORDER BY Name COLLATE NOCASE ASC

RE: [sqlite] Re: inner join

2007-07-16 Thread Joe Wilson
Let's assume we're using this schema: CREATE TABLE A(Id INTEGER PRIMARY KEY, Field1, Flag); CREATE TABLE B(Id INTEGER PRIMARY KEY, Field_Temp, Price); CREATE INDEX B2 on B(Field_Temp, Price); CREATE INDEX A1 on A(Field1, Id); You can extend Igor's pattern for more than 1 column: explain

Re: [sqlite] Re: Re: inner join

2007-07-16 Thread bartsmissaert
Thanks for that. I looked there, but overlooked it. RBS > RB Smissaert <[EMAIL PROTECTED]> > wrote: >> Where could I find documentation about coalesce? > > http://sqlite.org/lang_expr.html > > Near the bottom where all the built-in functions are described. > > Igor Tandetnik > >

RE: [sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-16 Thread Samuel R. Neff
Rollback is automatic if no Commit is issued in SQLite.NET. If you want custom logic, such as including additional exception information, then use try/catch BeginTransaction(); try { .. Commit(); } catch(Exception ex) { RollBack(); throw new Exception("An exception occurred and the

[sqlite] Inconsistent PRAGMA locking_mode command output

2007-07-16 Thread Ken
Why does the command: Pragma locking_mode = EXCLUSIVE; generate output of "exclusive" where other pragmas such as Pragma synchrous = off; do not generate any output whatsoever? Thanks, Ken

RE: [sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-16 Thread Ahmed Sulaiman
Thanks for the reply. I have got the code for the binding and it actually does roll back automatically in case of exceptions. :) Ahmed -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 16, 2007 12:14 PM To: sqlite-users@sqlite.org Subject: Re:

RE: [sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-16 Thread Robert Simpson
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Monday, July 16, 2007 9:14 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Does Transaction object roll back > automatically on exceptions? > > "Ahmed Sulaiman" <[EMAIL PROTECTED]> wrote: > > Hi

RE: [sqlite] Does Transaction object roll back automatically on exceptions?

2007-07-16 Thread Ahmed Sulaiman
Hi all, Is it necessary to run a "SELECT" command in between a transaction? I have few places in my code where I have a command that reads some data from a table, and I wonder if I should begin/commit a transaction? Is there any performance issues if I did or didn't do that? Regards

Re: [sqlite] sqlite3

2007-07-16 Thread Uma Krishnan
How about the various implementations to use SQLite in client server environment (based on wiki): http://www.it77.de/sqlite/sqlite.htm http://www.oneledger.co.uk/sql4sockets.html http://users.iol.it/irwin/ http://sqlitedbms.sourceforge.net/ Does anyone have any experience any of these? Pros and

[sqlite] UPDATE during SELECT

2007-07-16 Thread Larry Lewis
If I am stepping through the results of a SELECT and want to UPDATE values in the currently selected row prior to completion of the SELECT query, will this work? What if there is already a pending writer lock on the database from a different thread? Thanks. Larry