You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fischer (JIRA)" <ji...@apache.org> on 2006/05/01 17:40:47 UTC

[jira] Created: (TORQUE-10) doSelectJoinYYY in Oracle fails with limit/offset and same column names

 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
        Type: Bug

  Components: Runtime  
    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


[jira] Commented: (TORQUE-10) doSelectJoinYYY in Oracle fails with limit/offset and same column names

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
    [ 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


[jira] Closed: (TORQUE-10) doSelectJoinYYY in Oracle fails with limit/offset and same column names

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-10?page=all ]

Thomas Vandahl closed TORQUE-10.
--------------------------------


>  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
>         Assigned To: Thomas Fischer
>             Fix For: 3.3
>
>
> 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


[jira] Resolved: (TORQUE-10) doSelectJoinYYY in Oracle fails with limit/offset and same column names

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-10?page=all ]

Thomas Fischer resolved TORQUE-10.
----------------------------------

    Fix Version/s: 3.2.1
       Resolution: Fixed
         Assignee: Thomas Fischer

Was fixed by automatically aliasing one of the duplicate columns.

>  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
>         Assigned To: Thomas Fischer
>             Fix For: 3.2.1
>
>
> 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