AFAIK, NH does not support SP return values nor output params; if you want
to retrieve a scalar, your SP should issue a select that returns a single
record, with a single column.

Recommended read:
http://nhforge.org/doc/nh/en/index.html#querysql-namedqueries

<http://nhforge.org/doc/nh/en/index.html#querysql-namedqueries>   Diego


On Fri, Apr 16, 2010 at 08:24, Jon Moore <[email protected]> wrote:

>
> Guys,
> I have recently started a new project where we are using a legacy database,
> predominately using store srocs which we hope to migrate.
>
> However we have a few which are returning single boolean values, I was
> hoping to use named queries without having to create a return class mapping,
> like so:
>
> <sql-query name="bs_sp_ImportFromBackup">
>     <return-scalar column="Restored" type="Boolean" />
>     exec [bs_sp_ImportFromBackup]
>   </sql-query>
>
>
>  using (ISession session = this._sessionManager.OpenSession())
>  {
>                 IQuery query =
> session.GetNamedQuery("bs_sp_ImportFromBackup");
>
>                 return test = query.UniqueResult<bool>();
>  }
>
>
> as it turns out the sproc gets executed beautifully and we can see the
> results in the database, but the return value is always false - despite what
> is being returned.
>
> I get the same thing with integer return types from sprocs aswell (i
> thought it might be a bit - boolean issue)...
>
> Any help would be greatly appreciated!
>
> Ta,
> Jon
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to