-->
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.  [ 4 posts ] 
Author Message
 Post subject: Store Procedure in Hibernate
PostPosted: Tue Oct 30, 2007 12:14 pm 
Newbie

Joined: Tue Oct 30, 2007 12:08 pm
Posts: 1
Hello!
Is it possible to access stored procedure with out parameter in Hibernate?
My stored procedure is like this:
Quote:
create or replace procedure test1 (pi_1 in number,pi_2 in number, po_1 out number)
is
vi_1 number(4) default pi_1;
vi_2 number(4) default pi_2;
v_err varchar2(1000);
p_rc varchar2(1000);

begin
po_1:= vi_1 + vi_2;

EXCEPTION
WHEN OTHERS THEN
v_err:=' ERR: An error occurred with info :'||SQLCODE||' errm '||SQLERRM||' ';
dbms_output.put_line(v_err);
p_rc:=SQLCODE;
end test1;


How should I declare it in xml file?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 05, 2007 1:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no it is not.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 05, 2007 6:30 pm 
Newbie

Joined: Wed Oct 31, 2007 5:36 pm
Posts: 13
See section 16.2.2

http://www.hibernate.org/hib_docs/reference/en/html/querysql.html

out-parameter must be first parameter.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 06, 2007 3:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...the out parameter only have to be this returned one out parameter in case of Oracle - oracle is the only SP enabled db that doesn't support returning a resultset directly from a SP.

Arbitrary out parameters are not supported.

_________________
Max
Don't forget to rate


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