-->
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: String concatination
PostPosted: Thu Jun 10, 2004 3:11 am 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
This this valid HQL:

Code:
select distinct u from User u left join u.userGroups ug where (u.firstName || u.lastname) like :partial and (u.primaryGroup.groupId = :groupId or ug.group = :groupId)


The documentation says you can use || for concatination but sql server seems to barf:

Code:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Line 1: Incorrect syntax near '|'.


-- Glen


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2004 11:28 am 
Senior
Senior

Joined: Tue Sep 23, 2003 8:18 am
Posts: 137
Location: Johannesburg, South Africa
I'm guessing that this is more of an SQL 2000 issue. SQL2000 uses the normal + to concatenate text.

e.g.:

Code:
select top 1 customer.firstname + ' ' + customer.lastname
from customer


Try that, and see what you get.

-G


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.