Hibernate Books

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: Oracle named procedure
PostPosted: Fri Oct 21, 2011 9:28 am 
Newbie

Joined: Fri Oct 21, 2011 9:20 am
Posts: 3
HELLO.

I know that this subject was mentioned before, but i did not find any real answer.
I'm creating a named procedure in nhibernate xml:

<sql-query name="GetSysVal">
<return class="Person">
<return-property name="LastName" column="Value" />
</return>
{call GetOptValue(?,'xxx' ,null,null,null) }
</sql-query>

When a call proc in c# code like this:

String result = hqlSupport.Session.GetNamedQuery("GetSysVal").UniqueResult<String>();

I receve a following error:

Expected positional parameter count: 1, actual parameters: [] [{call GetOptValue(?,'xxx' ,null,null,null) }]

Can anyone tell me whats wrong with tis implementation?
BTW Nhibernate ver. 3.1.something Oracle DB 10 g

PLEASE HELP!!!


Top
 Profile  
 
 Post subject: Re: Oracle named procedure
PostPosted: Mon May 07, 2012 2:41 am 
Newbie

Joined: Thu May 03, 2012 10:20 pm
Posts: 4
Share information!


Top
 Profile  
 
 Post subject: Re: Oracle named procedure
PostPosted: Tue May 08, 2012 10:19 am 
Newbie

Joined: Fri Apr 27, 2012 6:23 pm
Posts: 3
I think you should use something like call GetOptValue(@LastName,'xxx' ,null,null,null). Take a look @ this calls in my code to mysql store procedures, may be something here can make sense for you:

Code:
...
Dim objCommand As New MySqlCommand()
objCommand.Connection = objConnection
objCommand.CommandText = "call read_person_images(@p_personID)"
objCommand.CommandType = CommandType.Text

objCommand.Parameters.Add("@p_personID", MySqlDbType.Int64).Value = personID

Dim objAdapter As New MySqlDataAdapter(objCommand)
Dim objDataResult As New DataSet

objAdapter.Fill(objDataResult)
...

_________________
Diego Alejandro Torres Fuerte
-----------------------------------
Developer
E. diego.torres.fuerte@gmail.com


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.