Hi,
I am using a recursive CTE to retrieve some data:
string query = @"with c(ChildId) as
(
-- Anchor member definition
select ChildId
from ItemLineage
WHERE ParentId = :ParentId
union all
-- Recursive member definition
select il.ChildId
from ItemLineage il inner join c p on
p.ChildId = il.ParentId
)
select
a.CategoryId,
a.CategoryName
from dbo.Categories as a
left outer join c as b on a.CategoryId =
b.ChildId
where b.ChildId is null and a.CategoryId !
= :CategoryId";
This works fine:
NHibernateHelper.GetCurrentSession().CreateSQLQuery(query)
.SetParameter("ParentId", ParentId)
.SetParameter("CategoryId", ParentId) .List<object>();
But as soon as I use:
NHibernateHelper.GetCurrentSession().CreateSQLQuery(query)
.SetParameter("ParentId", ParentId)
.SetParameter("CategoryId", ParentId)
.SetFirstResult((int)start_index)
.SetMaxResults((int)number_of_requested_rows)
.List<object>();
I get problems. Any feedback very much welcome. Many thanks in
advance.
Best wishes,
Christian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---