This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 354344 - concat function inside a sub select does not work
Summary: concat function inside a sub select does not work
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 05:00 EDT by Oliver Baum CLA
Modified: 2022-06-09 10:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Baum CLA 2011-08-10 05:00:14 EDT
Build Identifier: 2.3.0

A concat function inside a sub select doesn't work in a query.

The query:

Query query = em.createQuery(
"select distinct v from Partnersuche v where v.partnerIndex  in 
(SELECT concat(p.pk.nebenPartnerNr, max(p.pk.paLfdAdressNr)) 
from PartnersucheV p where p.psPartnerartKey = 1 group by p.pk.nebenPartnerNr)"
);

ERROR:

java.lang.IllegalArgumentException: An exception occurred while creating a
query in EntityManager:
Exception Description: Syntax error parsing the query [select distinct v
from Partnersuche v where v.partnerIndex in (SELECT
concat(p.pk.nebenPartnerNr, max(p.pk.paLfdAdressNr)) from PartnersucheV p
where p.psPartnerartKey = 1 group by p.pk.nebenPartnerNr)], line 1, column
71: unexpected token [concat].
Internal Exception: NoViableAltException(16@[1292:16: ( DISTINCT )?])


I use JPA 2.0 and eclipselink 2.3 with a Oracle 11G database.

Thanks for help
Oliver

Reproducible: Always

Steps to Reproduce:
1. build a query with a concat function inside a sub select
2.
3.
Comment 1 Tom Ware CLA 2011-08-24 10:12:47 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 James Sutherland CLA 2012-02-06 14:35:38 EST
This works with Hermes

added test
Comment 3 James Sutherland CLA 2012-04-11 10:41:01 EDT
Fixed in 2.4
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:27:34 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink