-->
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.  [ 3 posts ] 
Author Message
 Post subject: why CASE clause in SELECT in Firebird?
PostPosted: Thu Jun 03, 2004 9:11 am 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
hi there,

spring 1.0.1
hibernate 2.1.2
firebird1.0

hibernate.dialect = net.sf.hibernate.dialect.FirebirdDialect

why does hibernate generate a CASE clause in SELECT when using FirebirdDialect like this (an excerpt):

select col1,
case
when ... then 0
when ... then 1
when ... then 2
end
as clazz_, ...
from MyTable ac0_
....

Firebird 1.0 does not understand CASE.
This is log:
2004-06-03 15:35:36,382 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Exception>
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 35
when
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:91)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:34)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:682)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:232)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:187)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:228)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:703)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.Loader.list(Loader.java:940)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at org.springframework.orm.hibernate.HibernateTemplate$13.doInHibernate(HibernateTemplate.java:423)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:147)
at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:382)
at org.springframework.orm.hibernate.HibernateTemplate.find(HibernateTemplate.java:419)
.............................

Thanks,
Sergei.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 9:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Don't use joined-subclass or use firebird 1.5.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 11:30 am 
Beginner
Beginner

Joined: Mon Jan 05, 2004 12:48 pm
Posts: 31
thanks a lot :-)


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