-->
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.  [ 2 posts ] 
Author Message
 Post subject: Help with right outer join
PostPosted: Mon Jun 12, 2006 8:29 am 
Regular
Regular

Joined: Mon May 08, 2006 6:00 am
Posts: 53
Location: India
Hi,

I have following HQL which involves right outer join

SELECT count(*) FROM CholdersMain cm right outer join UserInfo ui on ui.strAcctNum=cm.strAcctNum where ui.intOrgID=312

in above query, CholdersMain , UserInfo are objects which are mapped to table

when I ran above query, following error occurs

Error : unexpected token: on near line 1, column 96 [SELECT count(*) FROM com.mypackage.data.CholdersMain cm right outer join UserInfo ui on ui.strAcctNum=cm.strAcctNum where ui.intOrgID=312]


basically in SQL "on" clause its failing......and UserInfo is not getting converted to com.mypackage.data.UserInfo.....any clue please

sudhir


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 12, 2006 8:57 am 
Beginner
Beginner

Joined: Thu Sep 01, 2005 7:43 am
Posts: 31
Location: León (Spain)
You are thinking too much in SQL...

How are CholdersMain and UserInfo related? This relation may change how the HQL should be written, but, anyway, this should work:

SELECT count(*) FROM CholdersMain cm, UserInfo ui WHERE ui.strAcctNum=cm.strAcctNum AND ui.intOrgID=312

Hope this helps.
Bye.

_________________
Please rate...

Expert on Hibernate errors... I've had them all... :P


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.