-->
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.  [ 5 posts ] 
Author Message
 Post subject: Calling a stored procedure with a NULL parameter value
PostPosted: Fri Jun 09, 2006 1:03 pm 
Newbie

Joined: Tue Jun 06, 2006 7:33 pm
Posts: 11
Hi,

I would like to know, how to pass a NULL value to a Stored Procedure (Oracle) as a parameter?

The stored procedure wait for several parameters, one of them is a Date wich is the one that can have a NULL value.

Oracle 9i
Hibernate3.1

Thank Stef-âne


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 09, 2006 4:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
.setDate(x, null) ? (like any other query)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: It does not work....
PostPosted: Mon Jun 12, 2006 5:45 am 
Newbie

Joined: Tue Jun 06, 2006 7:33 pm
Posts: 11
Hi, thank for the reply, but I does not work...

I call a Stored Procedure ModifFinPrev(?,?,?,?) with 4 parameters.

<sql-query name="ModifFinPrev" callable="true">
<return-scalar column="resultat" type="integer"/>
{ ? = call pkg_tournees.ModifFinPrev(?,?,?,?) }
</sql-query>

I trace the 4 parameters that I pass to the Oracle Store procedure:

PARAMETRE_0 SP: [(A)_TOTO]
PARAMETRE_1 SP: [10428]
PARAMETRE_2 SP: [2006-08-20 00:00:00.0]
PARAMETRE_3 SP: [null]

When I call it ,I expect a SQL Exception: like:

org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not execute query; bad SQL grammar [{ ? = call pkg_tournees.ModifFinPrev(?,?,?,?) }]; nested exception is java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'MODIFFINPREV'


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 12, 2006 7:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
this is an oracle/jdbc specific error - not hibernate.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 12, 2006 9:03 am 
Newbie

Joined: Tue Jun 06, 2006 7:33 pm
Posts: 11
I think so, but before I try several other drivers, Oracle thin, Weblogic ,...
and same error!

A second possibility is a Spring Bug, because I use it with the Hibernate 3 :HibernateDaoSupport.

thank


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