-->
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 in Property formula
PostPosted: Wed Feb 22, 2006 5:20 pm 
Newbie

Joined: Wed Nov 09, 2005 3:55 pm
Posts: 7
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Mapping documents:


<property name="isDeletable"

formula="(select count(memberProgram.PROG_LVL) from MBR_PROGRAM memberProgram where memberProgram.PROG_ID = PROG_ID and memberProgram.PROG_LVL = PROG_LVL)"

type="int" />




Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:


14:04:49,769 ERROR [JDBCExceptionReporter] [IBM][CLI Driver][DB2] SQL0104N An unexpected token "(" was found following "". Expected tokens may include: ", FROM INTO ". SQLSTATE=42601

14:04:49,769 ERROR [JDBCExceptionReporter] [IBM][CLI Driver][DB2] SQL0104N An unexpected token "(" was found following "". Expected tokens may include: ", FROM INTO ". SQLSTATE=42601


Name and version of the database you are using: DB2 UDB

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Hi, I'm trying to see if there is an element PROG_LVL present in the memberProgram table using

<property name="isDeletable"

formula="(select count(memberProgram.PROG_LVL) from MBR_PROGRAM memberProgram where memberProgram.PROG_ID = PROG_ID and memberProgram.PROG_LVL = PROG_LVL)"

type="int" />


I tried even other sql statements like :

formula="(select memberProgram.PROG_LVL from MBR_PROGRAM memberProgram where memberProgram.PROG_ID = PROG_ID and memberProgram.PROG_LVL = PROG_LVL)"


but its giving me errors in the SQL syntax.
pls advice me on this..
Thanx.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 10:49 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
The formula looks good to me. Can you post the output SQL?


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.