-->
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: error: expecting CLOSE, found '('
PostPosted: Thu Mar 23, 2006 12:47 pm 
Beginner
Beginner

Joined: Tue Jul 12, 2005 1:50 pm
Posts: 26
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0
Name and version of the database you are using:MySQL

count(concat(g.id,g.bnum)) gives me this error:

expecting CLOSE, found '('

I even added this:
registerFunction("concat", new SQLFunctionTemplate ibernate.CHARACTER, "concat(?1, ?2)"));

but still It gives me the same error.


Top
 Profile  
 
 Post subject: I solved the problem
PostPosted: Thu Mar 23, 2006 1:31 pm 
Beginner
Beginner

Joined: Tue Jul 12, 2005 1:50 pm
Posts: 26
It seems that count can not be combined with other functions. So
I registered this function:

registerFunction( "count_distinct_concat", new SQLFunctionTemplate( Hibernate.INTEGER, "count(distinct concat(?1,?2))" ) );


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.