-->
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: DECODE function is not working for dynamic param in HQL
PostPosted: Fri Nov 23, 2012 3:12 am 
Newbie

Joined: Fri Nov 23, 2012 2:36 am
Posts: 1
Hi i am trying to use the decode function in below mentioned HQL query in hibernate 3 in which i am setting :LANG_CODE as parameter but I am getting exception while running this

SELECT DECODE(:LANG_CODE,0,strUid_Desc,1,strUid_Desc_1,2,strUid_Desc_2,strUid_Desc), udsIdDefnInstance.strUid_Id FROM UdsIdDefnVO

its giving me this error
----------------------------------------------------------------
No data type for node: org.hibernate.hql.ast.tree.MethodNode
+-[METHOD_CALL] MethodNode: '('
| +-[METHOD_NAME] IdentNode: 'DECODE' {originalText=DECODE}
| \-[EXPR_LIST] SqlNode: 'exprList'
| +-[NAMED_PARAM] ParameterNode: '?' {name=LANG_CODE, expectedType=null}
| +-[NUM_INT] LiteralNode: '0'
| +-[DOT] DotNode: 'udsiddefnv0_.UID_DESC'

--------------------------------------------------

Its breaking my head,i googled it but didn't get any solutions.
Is any one having idea on setting parameter to decode function in HQL query will work or not..???if works then how can i achive this.!!!

Any help would be greatly appreciated....:)


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.