Re: [sqlite] Multilingual query

2010-11-23 Thread Igor Tandetnik
SQLumee SQLumee wrote: > Hi all, I am trying to retrieve multilingual information from a table but I > don't know how to do this query. > > I have a table defined as: > CREATE TABLE table2 (id integer, language text, title text, primary key (id, > language)); > > What I

Re: [sqlite] UPDATE during SELECT

2010-11-23 Thread Simon Slavin
On 24 Nov 2010, at 3:08am, Pavel Ivanov wrote: > Probably SQLite's implementation allows some other types of behavior, > but in any case behavior would be "erroneous" and unpredictable, so > you better avoid changing table that is currently being selected, or > at very least avoid changing

Re: [sqlite] UPDATE during SELECT

2010-11-23 Thread Pavel Ivanov
> Could there be any other > consequences like unpredictable behavior and such? Yes, it will be unpredictable and undefined behavior. I can't say exactly how SQLite will behave in such situation. What I know is it doesn't execute all select at once, it fetches row by row on each sqlite3_step

Re: [sqlite] UPDATE during SELECT

2010-11-23 Thread cricketfan
Pavel, What will happen if you had an index on the other_column for the select/update you mentioned below? Is it just that your tree will be unbalanced every time you change the other_column? Could there be any other consequences like unpredictable behavior and such? Thanks > Exactly

Re: [sqlite] A Bug? HAVE_LOCALTIME_S=0 under WinCE causes compile error

2010-11-23 Thread Afriza N. Arief
A quick fix/work-around will be to add the following at the top of sqlite3.c #define HAVE_LOCALTIME_S 0 #include struct tm *__cdecl localtime(const time_t *t); - afriza On Thu, Nov 18, 2010 at 3:38 PM, Afriza N. Arief wrote: > In my WinCE SDK, HAVE_LOCALTIME_S is defined

[sqlite] Multilingual query

2010-11-23 Thread SQLumee SQLumee
Hi all, I am trying to retrieve multilingual information from a table but I don't know how to do this query. I have a table defined as: CREATE TABLE table2 (id integer, language text, title text, primary key (id, language)); With this content: id language title -- --

Re: [sqlite] Reducing time to create indexes

2010-11-23 Thread Jay A. Kreibich
On Tue, Nov 23, 2010 at 10:13:34PM +, Paul Sanderson scratched on the wall: > I have a table with over 1 million rows and 20+ columns all of which > are indexed, Unless you have an extremely diverse set of queries, that seems excessive. A compound index is unlikely to need so many

Re: [sqlite] Reducing time to create indexes

2010-11-23 Thread Alexey Pechnikov
For all columns more useful may be FTS3 extension. 2010/11/24 Paul Sanderson > I have a table with over 1 million rows and 20+ columns all of which > are indexed, I reasonably regularly recreate the table with new data > and find that the indexing process takes

Re: [sqlite] Reducing time to create indexes

2010-11-23 Thread Simon Slavin
On 23 Nov 2010, at 10:13pm, Paul Sanderson wrote: > I have a table with over 1 million rows and 20+ columns all of which > are indexed Do you really need them all indexed ? You might be able to pick a few columns that people would never use as search criteria or for sorting results. Don't

[sqlite] Reducing time to create indexes

2010-11-23 Thread Paul Sanderson
I have a table with over 1 million rows and 20+ columns all of which are indexed, I reasonably regularly recreate the table with new data and find that the indexing process takes about 30 minutes. Are there any settings/tweaks that I can use to reduce the time required to create the index? The

Re: [sqlite] virtual tables

2010-11-23 Thread Vivien Malerba
On 23 November 2010 17:39, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 11/23/2010 02:04 AM, Vivien Malerba wrote: >> The Libgda library (http://www.gnome-db.org) uses virtual tables > > Are you sure?  It looks like an abstraction layer that

Re: [sqlite] virtual tables

2010-11-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/23/2010 02:04 AM, Vivien Malerba wrote: > The Libgda library (http://www.gnome-db.org) uses virtual tables Are you sure? It looks like an abstraction layer that sits above several databases, with similar functionality to ODBC/JDBC. We are

Re: [sqlite] FTS Question

2010-11-23 Thread Black, Michael (IS)
Actually this query might be more correctthe other would match any t/online.de combination -- so we restrict to NEAR/0 separation... select * from contacts where contacts match replace('t-online.de','-',' NEAR/0 '); m...@t-online.de Michael D. Black Senior Scientist Advanced Analytics

Re: [sqlite] FTS Question

2010-11-23 Thread Black, Michael (IS)
I went through this before. How's this look to you? Just replace the dashes with spaces and it works. select * from contacts where contacts match (replace('%t-online.de%','-',' ')); The problem is that the default tokenizer splits the address anyways at the hyphen and there's no way to turn off

Re: [sqlite] EXTERNAL: FTS Question

2010-11-23 Thread Black, Michael (IS)
I went through this before. How's this look to you? Just replace the dashes with spaces and it works. select * from contacts where contacts match (replace('%t-online.de%','-',' ')); The problem is that the default tokenizer splits the address anyways at the hyphen and there's no way to turn

Re: [sqlite] FTS Question

2010-11-23 Thread Michele Pradella
you have to use select * from contacts where contacts LIKE '%t-online.de%' Il 23/11/2010 14.53, ady ha scritto: > Hello! > > I am trying this query > > select * from contacts where contacts match ('*t-online.de*') > > How could i modify this query to return say m...@t-online.de ? > > the - is

[sqlite] FTS Question

2010-11-23 Thread ady
Hello! I am trying this query select * from contacts where contacts match ('*t-online.de*') How could i modify this query to return say m...@t-online.de ? the - is an exclusion Thanks in advance! Ady ___ sqlite-users mailing list

Re: [sqlite] virtual tables

2010-11-23 Thread Vivien Malerba
The Libgda library (http://www.gnome-db.org) uses virtual tables to enable one to execute statements on several tables from several database backends (SQlite, PostgreSQL, MySQL, Oracle, Jdbc, SqlCipher, MDB) and CSV files. Regards, Vivien ___

Re: [sqlite] Performing multiple actions on a query

2010-11-23 Thread Drake Wilson
Quoth Ian Petts , on 2010-11-23 19:20:05 +1100: > I know I can run the query again with a DELETE command, but what if > the data has changed in between queries? Not a problem if you do both of them in the same transaction, AFAIK. Surround both statements with a BEGIN/COMMIT

[sqlite] Performing multiple actions on a query

2010-11-23 Thread Ian Petts
I'm trying to move data between two databases. I found in the list archive the following solution from Chris Wedgwood: ATTACH DATABASE 'fromdb.sqlite' AS fromdb; [...] INSERT INTO fromdb.tablename SELECT * FROM src; This appears to *copy* data between databases, but I would like to then delete