Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 99177 invoked from network); 18 Jun 2007 23:26:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 23:26:45 -0000 Received: (qmail 21518 invoked by uid 500); 18 Jun 2007 23:26:48 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 21166 invoked by uid 500); 18 Jun 2007 23:26:47 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 21153 invoked by uid 99); 18 Jun 2007 23:26:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 16:26:47 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_PASS,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of the.mindstorm.mailinglist@gmail.com designates 64.233.162.227 as permitted sender) Received: from [64.233.162.227] (HELO nz-out-0506.google.com) (64.233.162.227) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 16:26:43 -0700 Received: by nz-out-0506.google.com with SMTP id n1so1561032nzf for ; Mon, 18 Jun 2007 16:26:22 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PO1yZtovtjns6gXHh7iF9h1LfMcVSnSi+y4m3V+fCqE2kc32Pvsp6Sm6jejmXJkNo3Uwh7IrvHXEgpBGrT02s7EU4ZohBXZ9XfDn9HUJK28mH7v093abXiPeEgpEaBq2wTGbvyyjwc1TJqngWIU5lw3U0cPLHbugVl5t3pStyOk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JcZWg0kd7CgfLlnehACOsSSiMn1Ox9cYkgzHFAI9zdMC9e9BkB5JAz3u4qwhke1COWi5n8Awza4RLQplhsS4zFiWkWstUPyJGZ4TYo7AqceFkt5br8SyGhbWV/MOCc2AJfTs38dhWlhIkthHNE8ASU39w/3lYUnG8xNH9yRBH/c= Received: by 10.114.175.16 with SMTP id x16mr6754032wae.1182209181920; Mon, 18 Jun 2007 16:26:21 -0700 (PDT) Received: by 10.114.150.12 with HTTP; Mon, 18 Jun 2007 16:26:21 -0700 (PDT) Message-ID: Date: Tue, 19 Jun 2007 02:26:21 +0300 From: "=?UTF-8?Q?Alexandru_Popescu_=E2=98=80?=" To: users@jackrabbit.apache.org Subject: Re: How to escape double quote in SQL term? In-Reply-To: <4676AA0B.9070602@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11025910.post@talk.nabble.com> <510143ac0706090135v2a759351kfb44e4028d04bd1f@mail.gmail.com> <11056250.post@talk.nabble.com> <4676AA0B.9070602@gmx.net> X-Virus-Checked: Checked by ClamAV on apache.org On 6/18/07, Marcel Reutegger wrote: > gsoap wrote: > > This does not work in case if we search only " see following query: > > you cannot search for the double quote character using the contains function. > the default tokenizer recognizes the character as noise and ignores it. > > > SELECT * FROM nt:base WHERE CONTAINS(., '""""') > > > > In the above query we have a single term and we are searching only " which > > you say should be replaced by "" but it results in parser exception. > > please note that you don't have to escape the the double quote in a SQL string > literal. you only have to escape the single quote: > > e.g. if you have the following String literal in your java code: > > String s = "this string contains ' a single quote"; > > when you use this string in a SQL contains function you must encode it like this: > > ... where contains(., 'this string contains '' a single quote') > > but here's the important part: double quotes in the string literal of a contains > function have a special semantic. they mark phrases. e.g. you can search for > nodes that contain the words apache and jackrabbit as consecutive terms: > > ... where contains(., '"apache jackrabbit"') > > if you have just one double quote or nothing between two double quotes the > parser will complain that the contains statement is malformed. > > regards > marcel > Hi Marcel! Thanks for the insights. I am wondering where are these bits documented? tia, ./alex -- .w( the_mindstorm )p.