-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Not working: SQL Subquery using "Group By" stateme
PostPosted: Thu Sep 18, 2003 10:30 am 
Newbie

Joined: Thu Sep 18, 2003 10:06 am
Posts: 2
Hi I'm having a problem running this SQL statement below. Can anyone help me?


select outage from outage in class uk.co.servicestatus.bo.PlannedOutage where outage.outageId in ( select MAX(poutage.outageId) FROM uk.co.servicestatus.bo.PlannedOutage poutage where poutage.ticketNo > 0 GROUP BY poutage.ticketNo) and and plannedoutage.po_ou
tage_status='In Progress'



is throwing an Exception as below



14:44:24,906 WARN [JDBCExceptionReporter] SQL Error: 907, SQLState: 42000
14:44:24,906 ERROR [JDBCExceptionReporter] ORA-00907: missing right parenthesis

14:44:24,906 ERROR [JDBCExceptionReporter] Could not execute query
java.sql.SQLException: ORA-00907: missing right parenthesis

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)


Looking at the logs as below, I understand that its hibernate is adding an extra ")" in the subquery implicitly before running the SQL on DB. Do you know why its adding or what to do about this?

From logs:

select plannedoutage.po_id as po_id, plannedoutage.po_ticket_no as po_ticke2_, plannedoutage.po_name as po_name from planned_outage plannedoutage where (plannedoutage.po_id in(select MAX(poutage.po_id) from planned_outage poutage) group by poutage.ticketNo)and plannedoutage.po_outage_status='In Progress'


Any help will be well appreciated

thanks in advance
Kamal


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 10:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
what version of Hibernate is this? I have some hazy memory that I may have implemented support for "group by" in a subquery quite recently.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 22, 2003 8:49 am 
Newbie

Joined: Thu Sep 18, 2003 10:06 am
Posts: 2
Got version 2.03 (27.08.2003) and it worked fine. Thanks for that


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.