Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 95916 invoked from network); 22 Oct 2007 14:32:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Oct 2007 14:32:33 -0000 Received: (qmail 81134 invoked by uid 500); 22 Oct 2007 14:32:19 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 81118 invoked by uid 500); 22 Oct 2007 14:32:19 -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 81107 invoked by uid 99); 22 Oct 2007 14:32:19 -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 07:32:19 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=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 14:32:21 +0000 Received: from dmz-scan-01.unycom.com (localhost [127.0.0.1]) by localhost.unycom.com (Postfix) with ESMTP id B497290C517 for ; Mon, 22 Oct 2007 16:33:17 +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 A7DAA90C4FCfor ; Mon, 22 Oct 2007 16:33:15 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: AW: generated SQL criteria using date comparison does not work with MaxDB: {ts XXX} instead of {d XXX} Date: Mon, 22 Oct 2007 16:31:55 +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: AcgUgPUdH6NFw2awSUmaeleZIUgicwAKr+OAAAMIwBA= From: "Alexander Zimmer" To: "Apache Torque Users List" 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(15500.000) X-imss-scores: Clean:99.90000 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 The Torque XML definition is DATE, thus correct. I think you are on the right track with your assumption that the MaxDB = adaptor is falling short of excellence. I will try to check out the test = suite against my MaxDB and let you know ... Cheers, Alex Mit freundlichen Gr=FC=DFen / Kind regards, ___________________________________ Alexander Zimmer =20 Unycom Information Technology Services GmbH Solutions for Intellectual Property Management Schmiedlstra=DFe 1 / III, 8042 Graz / Austria Tel.: +43 316 81 88 28 - 448 Fax: +43 316 81 88 28 - 938 E-Mail: alexander.zimmer@unycom.com Web: www.unycom.com UID Nr.: ATU 50837803; Firmenbuch Nr: FN 203321b / LG Graz =20 -----Urspr=FCngliche Nachricht----- Von: Greg Monroe [mailto:Greg.Monroe@DukeCE.com]=20 Gesendet: Montag, 22. Oktober 2007 15:52 An: Apache Torque Users List Betreff: RE: generated SQL criteria using date comparison does not work = with MaxDB: {ts XXX} instead of {d XXX} One quick thing to check is that you have defined the field=20 as DATE in the Torque XML and not TIMESTAMP. Sometimes a=20 missmatch in DB vs XML schema can cause this sort of thing. If that is already set, then it may be an issue with the DBSapDB=20 adaptor class not having a DB specific getDateString(Date) method defined. The SVN history on this adaptor does not show much a lot of activity, which generally indicates no one has access to it for testing during version releases. (Or it could just be a=20 stable adaptor). In general, most modern DBs (JDBC drivers?) will now handle the=20 conversion of dates if the query is simply something like=20 'yyyy mm dd hh:MM:ss' and doesn't have the DB specific ts or d delimiter. Alternatively, if the SapDB can use the D'xxx' format for both date and timestamp fields, the getDateString method could return this format. AFAIK, there is no free developer edition of the MaxDB product, so this DB Adaptor depends on someone with access to a MaxDB server to test it. If you have the time, it would be great if you could check out the code from SVN and running the test=20 project against your MaxDB server (see developer information=20 on the web site). This will test the adaptor against a large set of known adaptor problems (and other things). Let us know if there are problems (or better yet, no problems). We'll be happy to work with you to update the DB adaptor=20 if needed. > From: Alexander Zimmer >=20 > I'm using Torque 3.3 with SAP's MaxDB 7.5. >=20 > This is what I want to do: >=20 > ----------------------------------- >=20 > Criteria criteria =3D new Criteria(); >=20 > criteria.add(OrdersPeer.DELIVERY_DATE, cal.getTime(),=20 > Criteria.LESS_EQUAL); >=20 >=20 > This should bring up all rows with a "DELIVERY DATE" of max.=20 > the date in the calender object "cal". The column DELIVERY=20 > DATE ist DATE column (not timestamp). Thus, it should be rendered as: >=20 > SELECT DISTINCT ORDERS.ORDER_ID FROM ORDERS WHERE=20 > ORDERS.DELIVERY_DATE<=3D{d '2007-10-29'} >=20 > which would work fine. >=20 > The problem: >=20 > ---------------- >=20 > However, Torque generates this constraint (only difference is=20 > the use of {ts XXX} instead of {d XXX}): >=20 > SELECT DISTINCT ORDERS.ORDER_ID FROM ORDERS WHERE=20 > ORDERS.TARGET_DELIVERY_DATE<=3D{ts '2007-10-29 09:35:09.556'} >=20 > Unfortunately, this leaves me with an internal MaxDB error:=20 > move error. > Don't ask me why the error message is apparently unrelated to=20 > the problem, I tried do execute this query in a MaxDB client=20 > and found that if I change the constraint to a pure date-wise=20 > comparison (as shown > above) it would work. >=20 > Is this a known issue? I am not 100% sure if this in fact is=20 > a MaxDB error? IMHO it should work with timestamps as well.=20 > Anyway, if Torque would use date comparison ({d XXX} instead=20 > of {ts XXX}), it would work too. How can I get this to work? >=20 > TIA, >=20 > Alex >=20 >=20 DukeCE 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-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org