-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem With Left Outer join plz help its urgent
PostPosted: Thu Sep 25, 2008 7:28 am 
Newbie

Joined: Thu Jul 17, 2008 2:16 am
Posts: 11
Hi,
I have written a query which have joins from multiple table when I runs the query on SQL it runs but when I try to run with the createQuery option provided by Hibernate it gives error . Below is my query

SELECT custs.xwg4tx, custs.xwb3cd, custs.xwhitx, custs.xwe0nb, custs.xwjun0, custs.xwdvcd, cusgrp.xwkhtx, slmen.pname, dists.dname, custs.xwgiva, custs.xwbtcd, custs.xwaocd, custs.xwbbcd, custs.xwg4t0, custs.xwc7st, custs.xwdast, custs.xwbpd0, custs.xwbad0, custs.xwf0va, custs.xwasdt, custs.xwf0v0, custs.xwbqdt, custs.xwf1va, custs.xwf1v0, custs.xwf2va, custs.xwf3va, custs.xwf4va, custs.xwf6va, custs.xwidv0, custs.xwgava, custs.xwgbva, custs.xwgcva, custs.xwgdva, custs.xwgeva, custs.xwgfva, custs.xwggva, custs.cusno, custs.xwbccd, custs.xwbncd, custs.person, custs.dsdcde, custs.xwb2cd FROM com.databorough.hbmbean.Custs AS custs LEFT OUTER JOIN Cusgrp AS cusgrp ON custs.xwbncd=cusgrp.xwbncd LEFT OUTER JOIN Slmen AS slmen ON custs.person=slmen.person LEFT OUTER JOIN Dists AS dists ON custs.dsdcde=dists.dsdcde WHERE xwbccd = 'ACC1'

Error is :

unexpected token: ON near line 1, column 670

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2008 8:08 am 
Beginner
Beginner

Joined: Thu Jun 14, 2007 4:33 am
Posts: 39
try "with" instead:
Code:
left outer join foo with bar = yxz


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2008 8:23 am 
Newbie

Joined: Thu Jul 17, 2008 2:16 am
Posts: 11
I am not understand well can u explain it or modify my query


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2008 9:48 am 
Beginner
Beginner

Joined: Thu Jun 14, 2007 4:33 am
Posts: 39
simply use the keyword "with" instead of "on". otherwhise you could use subquerries.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.