Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 2711 invoked from network); 6 Oct 2006 12:28:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Oct 2006 12:28:18 -0000 Received: (qmail 89205 invoked by uid 500); 6 Oct 2006 12:28:17 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 89173 invoked by uid 500); 6 Oct 2006 12:28:17 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 89161 invoked by uid 99); 6 Oct 2006 12:28:16 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Oct 2006 05:28:16 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [62.109.82.234] ([62.109.82.234:53362] helo=mail.cadooz.de) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id EF/98-18133-CDB46254 for ; Fri, 06 Oct 2006 05:28:13 -0700 Received: from [192.168.107.5] (helo=securemail.cadooz-ag.intern) by gateway.cadooz-ag.intern with esmtp (Exim 4.43) id 1GVooE-0002Bl-TY for torque-user@db.apache.org; Fri, 06 Oct 2006 14:28:10 +0200 Received: from securemail (localhost [127.0.0.1]) by securemail.cadooz-ag.intern (Postfix) with ESMTP id E3A746BC058 for ; Fri, 6 Oct 2006 14:28:10 +0200 (CEST) Received: from srv-master.cadooz-ag.intern (srv-master.cadooz-ag.intern [192.168.107.3]) by securemail.cadooz-ag.intern (Postfix) with ESMTP id DD05B6BC057 for ; Fri, 6 Oct 2006 14:28:10 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: AW: Oracle - Null and Zero-length string problem Date: Fri, 6 Oct 2006 14:29:04 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Oracle - Null and Zero-length string problem Thread-Index: AcbmovNu7bDxAukmQg6SVUDXXK/12wCnzN9A From: "Thoralf Rickert" To: "Apache Torque Users List" X-TBoneOriginalFrom: "Thoralf Rickert" X-TBoneOriginalTo: "Apache Torque Users List" X-TBoneDomainSigned: false X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Just one idea - I'm not using Oracle - but what about: (column =3D '' OR column IS NULL) In Torque Criteria.Criterion c1 =3D criteria.getNewCriterion(COLUMN, "", = Criteria.EQUAL); Criteria.Criterion c2 =3D criteria.getNewCriterion(COLUMN, = (Object)null, Criteria.ISNULL); criteria.add(c1.or(c2)); ? Does this work in Oracle. In MySQL this isn't a problem. > -----Urspr=FCngliche Nachricht----- > Von: Parthasarathy Thandavarayan=20 > [mailto:Parthasarathy.Thandavarayan@sos.sungard.com]=20 > Gesendet: Dienstag, 3. Oktober 2006 06:18 > An: torque-user@db.apache.org > Betreff: Oracle - Null and Zero-length string problem >=20 >=20 > Hi all, >=20 > I am working on an framework that uses torque 3.2 as the ORM=20 > layer. Everything works perfectly on MySQL 4.1 and I am right=20 > now trying to make it work on Oracle 10g also. One of the=20 > problems i am facing is with respect to the difference in the=20 > way oracle handles zero-length strings ('') when compared to=20 > other dbs. In oracle zero-length strings are treated as null.=20 > If we are inserting '' in a column and query it back with=20 > where clause --> where =3D '' no rows will be=20 > returned. We should rather query it with the where clause -->=20 > where is null.=20 > On other dbs for eg., MySQL 4.1 the where clause condition=20 > should be --> where =3D ''.=20 >=20 > If I change the where clause to IS NULL then the app wont=20 > work on MySQL.. If I retain it as '' then it wont work on=20 > Oracle. Can anyone help me with a solution or workaround for this?=20 >=20 > One possible way to make it work is by changing the=20 > SQLExpression class to convert the criteria to null from ''=20 > if the db is oracle. Is there anyother way to make this work?=20 > the only restriction is that the same where clause should=20 > work on all dbs >=20 >=20 > Thanks, >=20 > Sarathy >=20 > =20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org