-->
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.  [ 1 post ] 
Author Message
 Post subject: HQL Question – doing a NOT IN comparing a VARCHAR and BIGI
PostPosted: Tue Jul 08, 2008 5:07 pm 
Newbie

Joined: Tue Jul 08, 2008 4:54 pm
Posts: 1
I need to do the following SQL in HQL:

select * from item i
where BIGINT(i.acct) NOT IN (select accountnumber
from DACS_INDICATOR_TABLE)

acct = VARCHAR
accountnumber = BIGINT

HQL =

from ItemVO as item where item.acct not in
(select dacs.acctNumber from DACSIndicatorTableVO as dacs)


but this gives an error

“SEVERE: The data types of the operands for the operation "IN" are not compatible.”

Is there a way to convert the VARCHAR to a BIGINT in HQL?

I found the cast(… as …) function but I have not been able to get it to work.


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

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.