From torque-dev-return-7201-apmail-db-torque-dev-archive=db.apache.org@db.apache.org Wed Oct 11 21:09:33 2006 Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 63821 invoked from network); 11 Oct 2006 21:09:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2006 21:09:33 -0000 Received: (qmail 77579 invoked by uid 500); 11 Oct 2006 21:09:33 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 77566 invoked by uid 500); 11 Oct 2006 21:09:32 -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 77555 invoked by uid 99); 11 Oct 2006 21:09:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 14:09:32 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 14:09:32 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EDE5F7142FD for ; Wed, 11 Oct 2006 14:08:50 -0700 (PDT) Message-ID: <9178562.1160600930971.JavaMail.jira@brutus> Date: Wed, 11 Oct 2006 14:08:50 -0700 (PDT) From: "Thomas Fischer (JIRA)" To: torque-dev@db.apache.org Subject: [jira] Commented: (TORQUE-10) doSelectJoinYYY in Oracle fails with limit/offset and same column names In-Reply-To: <6683857.1146498047616.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/TORQUE-10?page=comments#action_12441556 ] Thomas Fischer commented on TORQUE-10: -------------------------------------- For example, in the test project, Torque 3.2 would produce statements like this (irrelevant columns removed): SELECT B.* FROM ( SELECT A.*, rownum AS TORQUE$ROWNUM FROM ( SELECT book.author_id, author.author_id FROM book, author WHERE book.author_id=author.author_id) A ) B WHERE B.TORQUE$ROWNUM > 5 AND B.TORQUE$ROWNUM <= 15; which would produce the following Error: ORA-00918: column ambiguously defined The problem is that the prefix from the column is removed. The following does also not work: SELECT book.author_id, author.author_id from (SELECT book.author_id, author.author_id, rownum AS TORQUE$ROWNUM FROM (SELECT book.author_id, author.author_id FROM book, author WHERE book.author_id=author.author_id) ) WHERE TORQUE$ROWNUM > 5 AND TORQUE$ROWNUM <= 15; which fails with ORA-00904: "AUTHOR"."AUTHOR_ID": invalid identifier (tested with 10.2.0.1) The only way I see around this is to use aliases for equally named colums. Aliases should be used only in the necessary cases, so that people who address columns by their names will be able to do that in most cases. > doSelectJoinYYY in Oracle fails with limit/offset and same column names > ------------------------------------------------------------------------ > > Key: TORQUE-10 > URL: http://issues.apache.org/jira/browse/TORQUE-10 > Project: Torque > Issue Type: Bug > Components: Runtime > Affects Versions: 3.2 > Environment: Oracle > Reporter: Thomas Fischer > > Reported by Bouvet Konsulent: If a criteria with a limit or Offset is used in XXXPeer.doSelectJoinYYY(Criteria), and the Tables XXX and YYY have columns with same names, the method fails with a ORA-00918: column ambiguously defined. > This is because the "select *" from the limit/offset query clashes with the two same names in the inner select clause. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org