Re: [Refdb-devel] parentheses in keywords
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mar...@mh...> - 2004-01-28 21:20:54
|
Hi Rob, I had a second look at this issue. The difference between sqlite and the other database servers is that the former does not use Unix regexps but the simpler SQL regexps instead. Parentheses do not have a special meaning in SQL regexps, this is why it worked for me. MySQL and PostgreSQL use Unix regexps in queries like getref :KW:=whatever. This means that you have to escape any characters with a special meaning if you want them matched literally. The following query works for me using MySQL or PostgreSQL as a backend: getref ":KW:='52-67-5 \(Penicillamine\)'" Now the question is whether RefDB should offer the choice to do a literal match instead of a regexp match. regards, Markus rob caSSon writes: > > getref ":KW:='10102-43-9 (Nitric Oxide)'" > > > > works like a charm. The trick is to employ the double quotes to hide > > the single quotes from the query parser. This way they'll be left > > alone until the SQL tokenizer works on the actual query. > > i bet this works with sqlite...i'll have to give it a try, but the RLIKE > still wants the parentheses quoted in mysql according to the logs... > > i'll try to test postgresql later tonight, if i get the chance... > > staying db-agnostic is often a pain, but i'm glad you're doing it.... > > -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |