logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: parentheses in keywords: msg#00007

Subject: Re: parentheses in keywords
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
markus.hoenicka@xxxxxxx
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn


<Prev in Thread] Current Thread [Next in Thread>