-->
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: IN expression follow by a SELECT
PostPosted: Mon Nov 17, 2003 11:53 am 
Newbie

Joined: Mon Nov 17, 2003 11:44 am
Posts: 6
Hye,

I'm a newbie and have a trouble with the following query :

List list = session.find("from Pelftvllotpn A where timestamp(A.ddlanpn,A.dhlanpn) in (select timestamp(X.ddlanpn,X.dhlanpn) from Pelftvllotpn X)");

An exception is thrown about the second timestamp : select timestamp(X.ddlanpn,X.dhlanpn) from Pelftvllotpn X.
It is : "undefined alias: timestamp ..."

However, the following query works :
List list = session.find("from Pelftvllotpn A where timestamp(A.ddlanpn,A.dhlanpn) in ('1970-01-01-00.00.00', '1970-02-01-00.00.00')");

Does anyboy have an idea ?

Thank's a lot !

(Great framework, We wish it a long life)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2003 12:19 pm 
Regular
Regular

Joined: Mon Sep 08, 2003 4:53 am
Posts: 70
Location: Germany
Is there a function / procedure "timestamp" declared at your database?


Top
 Profile  
 
 Post subject: Re: IN expression follow by a SELECT
PostPosted: Mon Nov 17, 2003 9:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
didoudao wrote:
Hye,

I'm a newbie and have a trouble with the following query :

List list = session.find("from Pelftvllotpn A where timestamp(A.ddlanpn,A.dhlanpn) in (select timestamp(X.ddlanpn,X.dhlanpn) from Pelftvllotpn X)");



The second select statement uses a timestamp dialect function which does not exist. The select clause has limited fucntions that can be applied here. This is a function that currently cannot be applied here. The where clause is fine as its passed directly through without hibernate (possibly) needing to manipulate it.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.