-->
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.  [ 1 post ] 
Author Message
 Post subject: How to call the default return value from Store procedure ?
PostPosted: Fri May 29, 2009 10:20 pm 
Newbie

Joined: Wed Jan 30, 2008 8:54 pm
Posts: 1
1.DataBase:SqlServer
2.Data Access:nHibernate 1.2

Now we need access the store procedure by nHibernate,like this:
ALTER PROCEDURE [dbo].[TestProc]()
AS
BEGIN
Select * From User
Return 1234
END
I know I can get the User List by IQuery,
And I want to get the default value "1234" too.

Question:
1.How to get this default return value?
2.If can't get it directly , can we get the value by output parameter?

===================================================
1.数据库:SqlServer
2.数据访问:nHibernate 1.2

现在需要用nHibernate访问数据库中的一个存储过程,类似如下:
ALTER PROCEDURE [dbo].[TestProc]()
AS
BEGIN
Select * From User
Return 1234
END
我知道可以IQuery对象访问该存储过程,得到这个User List,
但我现在除了想得到这个UserList 之外,还想得到我设定的返回值 "1234"

问题:
1.这个返回值是应该如何得到呢?
2.如果这个返回值不能直接获得,能否给存储过程添加output参数获得?如何获得?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.