-->
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: use hibernate formula with mySql 4.0
PostPosted: Tue Jan 31, 2006 3:15 am 
Newbie

Joined: Fri Nov 25, 2005 10:01 pm
Posts: 7
I am using MySql 4.0.23, and I want to use

<property name="area" formula="( SELECT (l.rows * l.cols) FROM landscape l where l.id = id ) " type="int"/>

but this results in SQL

select ..., ( SELECT (l.rows * l.cols) FROM landscape l where l.id = this_.id ) as formula0_0_, ... from landscape this_ where ...

but MySql 4.0 doesn't support subqueries. So I get:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax ...

Is there a workaround?


Top
 Profile  
 
 Post subject: mysql
PostPosted: Tue Jan 31, 2006 7:35 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
There is nice workaround:
Postgres : http://www.postgresql.org/

MySQL is well known for non-standard SQL and lack of support for SQL standards.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.