[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-3511) Sybase - Column alias in subselect doesn't works

Gail Badner (JIRA) noreply at atlassian.com
Mon Jan 5 23:04:38 EST 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved HHH-3511.
------------------------------

    Resolution: Duplicate

I'm resolving this as a duplicate of HHH-3032 because that issue provides more details.

> Sybase - Column alias in subselect doesn't works
> ------------------------------------------------
>
>                 Key: HHH-3511
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3511
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.4.sp1
>         Environment: Branch_3_2_4_SP1_CP with Sybase 15 
>            Reporter: Juraci Paixao Krohling
>            Assignee: Gail Badner
>
> I could not find any reference in documentation to support it, but it seems that column aliasing in sub-selects isn't supported. I could not find any information in the docs which confirms or denies this, but running the test CriteriaQueryTest#testDetachedCriteriaAsSubQuery can confirm this. 
> Hibernate generates a query which ends in:
> where ? in (select this_.courseCode as y0_ from Course this_ where this_.description like ?)
> This fails in Sybase, with this message:
> 15:29:38,063  WARN JDBCExceptionReporter:77 - SQL Error: 156, SQLState: ZZZZZ
> 15:29:38,074 ERROR JDBCExceptionReporter:78 - Incorrect syntax near the keyword 'AS'.
> Removing all "as" keywords returns the same message, even though the query itself doesn't have it. [1]
> Removing the "as $alias" solves the problem. 
> The working line is:
> where courseCode in (select this_.courseCode  from Course this_ where this_.description like 'test%')

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list