Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 44306 invoked from network); 22 Oct 2007 07:56:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Oct 2007 07:56:50 -0000 Received: (qmail 6892 invoked by uid 500); 22 Oct 2007 07:56:37 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 6873 invoked by uid 500); 22 Oct 2007 07:56:37 -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 6862 invoked by uid 99); 22 Oct 2007 07:56:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2007 00:56:37 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [195.58.186.253] (HELO dmz-scan-01.unycom.com) (195.58.186.253) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2007 07:56:41 +0000 Received: from dmz-scan-01.unycom.com (localhost [127.0.0.1]) by localhost.unycom.com (Postfix) with ESMTP id EA85B90C513 for ; Mon, 22 Oct 2007 09:57:05 +0200 (CEST) Received: from uny-srv-ex.unycom.com (uny-srv-ex.unycom.com [192.168.0.14])by dmz-scan-01.unycom.com (Postfix) with ESMTP id DD42A90C4FCfor ; Mon, 22 Oct 2007 09:57:05 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C81480.F579C02B" Subject: generated SQL criteria using date comparison does not work with MaxDB: {ts XXX} instead of {d XXX} Date: Mon, 22 Oct 2007 09:55:48 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: generated SQL criteria using date comparison does not work with MaxDB: {ts XXX} instead of {d XXX} Thread-Index: AcgUgPUdH6NFw2awSUmaeleZIUgicw== From: "Alexander Zimmer" To: X-imss-version: 2.048 X-imss-result: Passed X-imss-scanInfo: M:P L:E SM:0 X-imss-tmaseResult: TT:0 TS:0.0000 TC:00 TRN:0 TV:5.0.1023(15494.001) X-imss-scores: Clean:35.15636 C:2 M:3 S:5 R:5 X-imss-settings: Baseline:1 C:1 M:1 S:1 R:1 (0.0000 0.0000) X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C81480.F579C02B Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello list, =20 I'm using Torque 3.3 with SAP's MaxDB 7.5. =20 This is what I want to do: ----------------------------------- Criteria criteria =3D new Criteria(); criteria.add(OrdersPeer.DELIVERY_DATE, cal.getTime(), Criteria.LESS_EQUAL); =20 This should bring up all rows with a "DELIVERY DATE" of max. the date in the calender object "cal". The column DELIVERY DATE ist DATE column (not timestamp). Thus, it should be rendered as: SELECT DISTINCT ORDERS.ORDER_ID FROM ORDERS WHERE ORDERS.DELIVERY_DATE<=3D{d '2007-10-29'} =20 which would work fine. =20 The problem: ---------------- However, Torque generates this constraint (only difference is the use of {ts XXX} instead of {d XXX}): =20 SELECT DISTINCT ORDERS.ORDER_ID FROM ORDERS WHERE ORDERS.TARGET_DELIVERY_DATE<=3D{ts '2007-10-29 09:35:09.556'} =20 Unfortunately, this leaves me with an internal MaxDB error: move error. Don't ask me why the error message is apparently unrelated to the problem, I tried do execute this query in a MaxDB client and found that if I change the constraint to a pure date-wise comparison (as shown above) it would work. =20 =20 =20 Is this a known issue? I am not 100% sure if this in fact is a MaxDB error? IMHO it should work with timestamps as well. Anyway, if Torque would use date comparison ({d XXX} instead of {ts XXX}), it would work too. How can I get this to work? =20 TIA, Alex ------_=_NextPart_001_01C81480.F579C02B--