-->
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.  [ 2 posts ] 
Author Message
 Post subject: substring in select query
PostPosted: Sat Apr 17, 2004 7:47 am 
Newbie

Joined: Mon Apr 05, 2004 3:14 am
Posts: 13
hi,

i am trying to translate a ms sql select query into HQL.

query is :

select max( substring ( field ,1,5 )) as col1 from table1

max works ok with number fields.

but i have to substring a String field to get a integer then increment it.

i have searched the message board and faq. i am not not find any help.

what are my choices ? i don't want to load every value in a String array and loop.. that will increase response time.

do i have to use native sql ?


any tips are welcome.

iyyappan


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 17, 2004 7:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yes, you must use native SQL. We can't currently parse SQL functions with multiple arguments when they appear in the select clause.


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