-->
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: Usage of Locate function with criteria
PostPosted: Wed Apr 18, 2007 6:12 am 
Newbie

Joined: Wed Apr 11, 2007 2:05 am
Posts: 1
Location: India
Hi
i am using hibernate 3.2.2. i have a field in database which is stored as integer but we are converting that into a string value in the front end according to our requirement. the numbers given in the database is not in alphabetical order. (Ex: 1 for M, 2 for N, 3 for G etc). now i need to sort the values according to the alphabetical order. i have got an sql query for that but can anyone help me on how to implement this with criteria?
the query is
select * from org order by locate(cast(ORG_ID as char(1)),'831427')
i'm using DB2 v8.2 as the database

Thanks in advance
Sudeep


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.