From torque-dev-return-7290-apmail-db-torque-dev-archive=db.apache.org@db.apache.org Tue Nov 07 22:59:38 2006 Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 85640 invoked from network); 7 Nov 2006 22:59:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 22:59:38 -0000 Received: (qmail 34326 invoked by uid 500); 7 Nov 2006 22:59:49 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 34316 invoked by uid 500); 7 Nov 2006 22:59:49 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 34305 invoked by uid 99); 7 Nov 2006 22:59:49 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 14:59:49 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Greg.Monroe@dukece.com designates 65.112.55.73 as permitted sender) Received: from [65.112.55.73] (HELO mail.dukece.com) (65.112.55.73) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 14:59:35 -0800 Received: from dukece-mail3.dukece.com ([192.168.1.222]) by mail.dukece.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 7 Nov 2006 17:59:36 -0500 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: ESCAPE clause in LIKE statement Date: Tue, 7 Nov 2006 17:59:04 -0500 Message-ID: <8F5843B903F59D4C8C6806BB49A3911901D767CE@dukece-mail3.dukece.com> In-Reply-To: <20061107130413.Y37050@minotaur.apache.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ESCAPE clause in LIKE statement Thread-Index: AccCu2R3fzJFoa1bQpmwT/aPsEEwFAAA43PQ From: "Greg Monroe" To: "Apache Torque Developers List" X-OriginalArrivalTime: 07 Nov 2006 22:59:36.0078 (UTC) FILETIME=[655AE2E0:01C702C0] X-Virus-Checked: Checked by ClamAV on apache.org Hmm, "anyone having access to mssql"... I wonder who=20 he could be talking about.. 8) I'll see if I can pry myself away from Maven site=20 design to try it... FWIW - The MS SQL 2000 Docs indicate that there is=20 no default escape character. To use an escape char, you must add an ESCAPE clause in the LIKE statement. Sounds the same as Sybase (no surprise there...). AFAIK, the SQL standard doesn't really specify a default character, just the ESCAPE clause syntax=20 for LIKE statements. > -----Original Message----- > From: Thomas Fischer [mailto:tfischer@apache.org]=20 > Sent: Tuesday, November 07, 2006 5:23 PM > To: torque-dev@db.apache.org > Subject: ESCAPE clause in LIKE statement >=20 > From an email of in the Users list: >=20 > > > > SELECT * FROM CSFieldRegistry > > > > WHERE CSFieldRegistry.Name LIKE 'CSCLIENT\_%' > > > > AND CSFieldRegistry.CustomField=3D1 > > > > > > > > Please observe the LIKE clause in the above query. It =20 > works fine=20 > > > > on MySQL as MySQL knows that a backslash (\) is an=20 > escape sequence=20 > > > > for the underscore (_) > > > > > > > > But the query fails on Sybase as Sybase expects the=20 > query in the=20 > > > > following form. > > > > > > > > SELECT * FROM CSFieldRegistry > > > > WHERE CSFieldRegistry.Name LIKE 'CSCLIENT\_%' escape '\' > > > > AND CSFieldRegistry.CustomField=3D1 >=20 > One can add the "escape" clause by overriding the=20 > useEscapeClauseForLike() method in the adapte now, so I=20 > changed that for sybase. I have no idea whether this is=20 > needed in ms-sql also, so I left it at no escape character for ms-sql. >=20 > I have checked this for sybase, oracle, mysql, postgres, and=20 > derby. I'll check it for firebird, but I am not sure about=20 > the other databases.=20 > Especially, I am not sure about mssql. >=20 > Would anyone having access to mssql rmind to run the test=20 > project and check whether it throws any errors ? >=20 > Cheers, >=20 > Thomas >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org > For additional commands, e-mail: torque-dev-help@db.apache.org >=20 >=20 Duke CE Privacy Statement Please be advised that this e-mail and any files transmitted with it are = confidential communication or may otherwise be privileged or = confidential and are intended solely for the individual or entity to = whom they are addressed. If you are not the intended recipient you may = not rely on the contents of this email or any attachments, and we ask = that you please not read, copy or retransmit this communication, but = reply to the sender and destroy the email, its contents, and all copies = thereof immediately. Any unauthorized dissemination, distribution or = copying of this communication is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org