openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-607) Extraneous "( )" on DISTINCT, ALL, ANY results in SQL syntax errors on some database systems
Date Thu, 22 May 2008 08:03:55 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598937#action_12598937
] 

Michael Dick commented on OPENJPA-607:
--------------------------------------

Hi Catalina,

What's the benefit of leaving the parenthesis in? If they're truly extraneous I would think
that the default would be to not use them unless they're needed. 

The code changes provided affect ALL, DISTINCT and ANY, but does the same problem occur with
other UnaryOps? 

> Extraneous "( )" on DISTINCT, ALL, ANY results in  SQL syntax errors on some database
systems
> ---------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-607
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-607
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Catalina Wei
>
> In testing various back-end database systems such as Sybase, Informix. there are cases
where the extra pair of () resulted in SQL Syntax error:
> For example,
> 1. in generating ALL, ANY subquery, there is extraneous pair of "(  )"  that are tolerated
by most systems such as DB2, Oracle but not Sybase.
> WHERE (t0.DEPT_DEPTNO = ANY ((SELECT t1.deptno FROM DeptBean t1 WHERE (t1.deptno = ?
)))
> 2.In the case of DISTINCT function, Informix reports syntax error when argument/s of
the DISTINCT is/are parenthesized:
> SELECT COUNT(DISTINCT (t1.name)) FROM EmpBean t1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message