On Wed, Feb 10, 2010 at 11:08 PM, jflaming <jay.flam...@gmail.com> wrote: > > I'm new to SQLITE. > I'm trying to update a series of text entries for book titles that were > entered with underscores. I want to convert them to spaces. > I can run the query: > > select replace(title, '_', ' ') from books; > > and see the output I'm looking for, but if I try to do an update query and > actually perform the change: > > update books set title = replace(title, '_', ' '); > > it fails with this error: > Query Error: no such function: title_sort Unable to execute statement > > I'm sure I'm missing something simple here, but it's driving me crazy... any > ideas? >
One important thing you are missing is that you are not telling us how you are selecting and updating. Are you using the command line, another program, a programming language... and, which version of sqlite on which platform? Works for me... this is what I get on my Macbook SQLite version 3.6.19 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> CREATE TABLE books (title TEXT); sqlite> INSERT INTO books VALUES ('a_book'); sqlite> INSERT INTO books VALUES ('another_book'); sqlite> SELECT * FROM books; title ---------- a_book another_bo sqlite> SELECT Replace(title, '_', ' ') FROM books; Replace(title, '_', ' ') ------------------------ a book another book sqlite> UPDATE books SET title = Replace(title, '_', ' '); sqlite> SELECT * FROM books; title ---------- a book another bo sqlite> -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users