Re: [sqlite] Query to remove duplicate values ​​in a field?

2012-04-01 Thread Alessio Forconi
I tried this way but it does not work UPDATE September Notes Recipes = Replace (Notes, | |, 'Location:') where is the mistake? is there a way to update a field in this way? Fieldtoupdate: 1) Location: Rome. Location: New York. 2) Location: Florence. Location: Tuscany. Place: Arezzo I

Re: [sqlite] Query to remove duplicate values ​​in a field?

2012-04-01 Thread Igor Tandetnik
Alessio Forconi forco...@gmail.com wrote: I tried this way but it does not work UPDATE September Notes Recipes = Replace (Notes, | |, 'Location:') UPDATE MyTable set Notes = 'Location: ' || replace(Notes, 'Location: ', ''); -- Igor Tandetnik ___

[sqlite] table aliases in update

2012-04-01 Thread Baruch Burstein
Does sqlite not support table aliases in update statements? Is there a way to work around this to get the affect of update table1 t1 set col1 = col1 * 2 where col1 = (select avg(col1) from table1 where col2=t1.col2); -- Programming today is a

Re: [sqlite] table aliases in update

2012-04-01 Thread Petite Abeille
On Apr 1, 2012, at 3:09 PM, Baruch Burstein wrote: Does sqlite not support table aliases in update statements? Nope, no aliasing in the update itself. Is there a way to work around this to get the affect of update table1 t1 set col1 = col1 * 2 where col1 = (select avg(col1)

Re: [sqlite] table aliases in update

2012-04-01 Thread Igor Tandetnik
Baruch Burstein bmburst...@gmail.com wrote: Does sqlite not support table aliases in update statements? Indeed it does not. Is there a way to work around this to get the affect of update table1 t1 set col1 = col1 * 2 where col1 = (select avg(col1) from table1

Re: [sqlite] table aliases in update

2012-04-01 Thread Simon Slavin
On 1 Apr 2012, at 2:09pm, Baruch Burstein bmburst...@gmail.com wrote: Does sqlite not support table aliases in update statements? Is there a way to work around this to get the affect of update table1 t1 set col1 = col1 * 2 where col1 = (select avg(col1)

Re: [sqlite] table aliases in update

2012-04-01 Thread Igor Tandetnik
Simon Slavin slav...@bigfraud.org wrote: On 1 Apr 2012, at 2:09pm, Baruch Burstein bmburst...@gmail.com wrote: Does sqlite not support table aliases in update statements? Is there a way to work around this to get the affect of update table1 t1 set col1 = col1 * 2 where col1 =

Re: [sqlite] table aliases in update

2012-04-01 Thread Petite Abeille
On Apr 1, 2012, at 3:21 PM, Simon Slavin wrote: Can this be done with a JOIN instead of a sub-SELECT ? Not in SQLite, as the join clause is not supported in an update statement. For such functionality, look at MySQL or Postgress which do support variation of such syntax. Something like this

Re: [sqlite] table aliases in update

2012-04-01 Thread Simon Slavin
On 1 Apr 2012, at 2:24pm, Igor Tandetnik itandet...@mvps.org wrote: Simon Slavin slav...@bigfraud.org wrote: On 1 Apr 2012, at 2:09pm, Baruch Burstein bmburst...@gmail.com wrote: update table1 t1 set col1 = col1 * 2 where col1 = (select avg(col1) from table1

[sqlite] Geolocation database

2012-04-01 Thread Yan Seiner
I've been playing around with a geo-location database. I have a camera mounted on our travel van. Periodically, it takes pictures of where we are. I've written (OK, mostly re-written) various code I've found to tag the pics with location, lat/lon, date, time, direction, speed, and outside

Re: [sqlite] System.Data.SQLite version 1.0.80.0 released

2012-04-01 Thread Bernd
Am 31.03.2012 20:45, schrieb Joe Mistachkin: System.Data.SQLite version 1.0.80.0 (with SQLite 3.7.11) is now available on the System.Data.SQLite website: http://system.data.sqlite.org/ Further information about this release can be seen at

Re: [sqlite] System.Data.SQLite version 1.0.80.0 released

2012-04-01 Thread Joe Mistachkin
Bernd wrote: Could you be so kind and post a small example of how to use the Backup API from CSharp? I'm very interested in using it but have no clue how to convert the C-example on https://www.sqlite.org/backup.html to working CSharp code. Here is a quick example that copies a small

Re: [sqlite] System.Data.SQLite version 1.0.80.0 released

2012-04-01 Thread Bernd Lehmkuhl
Here is a quick example that copies a small database from memory to disk: using System.Data.SQLite; namespace BackupAPI { class Program { public static void BackupAndGetData() { using (SQLiteConnection source = new SQLiteConnection( Data Source=:memory:))

Re: [sqlite] table aliases in update

2012-04-01 Thread Yuriy Kaminskiy
Igor Tandetnik wrote: Baruch Burstein bmburst...@gmail.com wrote: Does sqlite not support table aliases in update statements? Indeed it does not. Is there a way to work around this to get the affect of update table1 t1 set col1 = col1 * 2 where col1 = (select avg(col1)

Re: [sqlite] Importing date string 'YYYYMMDD'

2012-04-01 Thread John McMahon
On 01/04/2012 12:34 PM, Igor Tandetnik wrote: Johnli...@jspect.fastmail.fm wrote: Can the date time functions in SQLite correctly interpret a date string like '20120331'? No. Recognized formats are documented here: http://sqlite.org/lang_datefunc.html Is there a format or modifier that

Re: [sqlite] Importing date string 'YYYYMMDD'

2012-04-01 Thread Simon Slavin
On 1 Apr 2012, at 6:59am, John McMahon j...@jspect.fastmail.fm wrote: Thanks Igor (and Simon) That is pretty much the path I was thinking of taking (or possibly externally as I import the data), was just wondering if I had missed something in the date functions. You're welcome. Since

[sqlite] Foreign Key Problems

2012-04-01 Thread Pete
I'm running into an issue with foreign keys where no matter what value I supply for a child key, I get a foreign key mismatch error. Here are my test tables. CREATE TABLE t1 (RefColumn TEXT ,Data TEXT ) CREATE TABLE t2 (FKeyColumn TEXT REFERENCES t1(RefColumn),Data TEXT ) PRAGMA foreign_keys

Re: [sqlite] sqlite-users Digest, Vol 52, Issue 1

2012-04-01 Thread YAN HONG YE
when I run this following code , the html file encoding changed to GB2312,not utf-8, I don't know why? system(echo ^table border='1'^ mm.html); system(sqlite3 -html -header foods.db \select * from dzh where qph1510;\ mm.html); system(echo ^/table^ mm.html);

Re: [sqlite] Foreign Key Problems

2012-04-01 Thread Pavel Ivanov
I get a foreign Key mismatch error.  No matter what value I supply for FKeyColumn, even NULL, I get the same error. Did you create unique index on t1 (RefColumn) ? IIRC, SQLite always fails foreign key check if there's no index on a referenced column. Pavel On Sun, Apr 1, 2012 at 8:22 PM,

Re: [sqlite] sqlite-users Digest, Vol 52, Issue 1

2012-04-01 Thread Roy Tam
2012/4/2 YAN HONG YE yanhong...@mpsa.com: when I run this following code  , the html file encoding changed to GB2312,not utf-8, I don't know why? system(echo ^table border='1'^ mm.html);   system(sqlite3 -html -header foods.db \select * from dzh where qph1510;\ mm.html);   system(echo

[sqlite] Adding R-Tree index module to existing project

2012-04-01 Thread A Gilmore
I have a project that compiles SQLite with the following options: -DSQLITE_SECURE_DELETE=1 -DSQLITE_THREADSAFE=1 -DSQLITE_CORE=1 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_DEFAULT_PAGE_SIZE=32768 -DSQLITE_MAX_DEFAULT_PAGE_SIZE=32768