-->
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: problems executing procedures
PostPosted: Tue Jun 17, 2008 9:53 am 
Beginner
Beginner

Joined: Wed Apr 23, 2008 2:00 pm
Posts: 20
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3

Hello,
I'm trying to call a procedure from my Oracle database.
In my mapping file, there is :

<sql-query name="procName" callable="true">
{ call PROC_MY_PROC(?,?) } </sql-query>

And in my java code :

List list = session.getNamedQuery("procName")
.setInteger(0, id)
.setString(1, p)
.list();

When i'm tying to execute I'm having this error :

Hibernate: { call PROC_MY_PROC(?,?) }
17/06/2008 10:49:41 org.hibernate.util.JDBCExceptionReporter logExceptions
ADVERTENCIA: SQL Error: 1006, SQLState: 72000
17/06/2008 10:49:41 org.hibernate.util.JDBCExceptionReporter logExceptions
GRAVE: ORA-01006: bind variable does not exist

Does anybody has an idea ?
Thanks in advance !


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 17, 2008 11:27 am 
Beginner
Beginner

Joined: Wed Apr 23, 2008 2:00 pm
Posts: 20
Hello again,
i found a wqay which works..
In the mapping file i've set callable="false"

<sql-query name="procName" callable="false">
{ call PROC_MY_PROC(?,?) } </sql-query>

and then in the java code :
int res = session.getNamedQuery("procName")
.setInteger(0, id)
.setString(1, p)
.executeUpdate();

Like this is working.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 17, 2008 3:21 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Sweet! Thanks for posting back with the solution. It helps everyone that hits this posting through Google or something.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.