> On 4/9/08, Richard Klein <[EMAIL PROTECTED]> wrote: >>> Richard Klein <[EMAIL PROTECTED]> >>> wrote: >>>> One question: I thought that the '\' character is not part of the >>>> SQL standard. (That's why I specified '/' instead as my ESCAPE >>>> character). >>> I'm not sure I understand. You can use any character as an escape >>> character. E.g. LIKE '2!_%' ESCAPE '!'. A backslash is as good as any. >>> >>> Igor Tandetnik >> I'm a SQL newbie, so I may very well be wrong about this ... >> >> My understanding is that you can use any legal SQL character as an escape >> character, but that a backslash is not a legal SQL character. >> >> I got this impression from a sentence I read on the SQLite website (in >> the description of literal numeric values): >> >> "C-style escapes using the backslash character are not supported because >> they are not standard SQL." >> > > If I understand correctly Igor Tandetnik's comment "A backslash is as > good as any.", in the above quote the phrase "they are not standard > SQL" refers to C-style escapes and not to the use of the backslash > character as an escape defined with ESCAPE. > > LIKE '2\_%' > > is not valid. > > LIKE '2\_%' ESCAPE '\' > > is valid. > > Robert Wishlaw >
I just now checked the use of backslash as an escape character in LIKE clauses, and it works just fine. So, regardless of whether backslash is a legal SQL character, it is apparently acceptable to SQLite, at least in LIKE clauses. - Richard Klein _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users