On Thu, Sep 01, 2011 at 02:52:06PM +0100, Simon Slavin scratched on the wall:
> Putting this here in the hope it comes in useful for someone sometime.
> 
> Have a table which has some text fields in it.  For use with an old
> system the text fields had newlines in which were expressed with C
> escapes: 'firstline\nsecondline'.  Here's how I fixed it:
> 
> UPDATE myTable SET textfield=REPLACE(textfield,'\n',x'0A');
> 
> If anyone can see a better way, or wants to note some hidden 
> danger with the above, I welcome it.  Including if there's a
> problem depending on whether the field is UTF-8 or UTF-16.


  If there are other C-style escapes, it will incorrectly deal
  with something like "\\n".

   -j


-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to