public override SqlString GetLimitString(SqlString sql, bool hasOffset)
{
sql = sql.Trim();
bool isForUpdate = false;
if (sql.EndsWithCaseInsensitive(" for update"))
{
sql = sql.Substring(0, sql.Length - 11);
isForUpdate = true;
}
var pagingSelect = new SqlStringBuilder(sql.Parts.Count + 10);
if (hasOffset)
{
pagingSelect.Add("select * from ( select row_.*, rownum rownum_ from ( ");
}
else
{
pagingSelect.Add("select * from ( ");
}
pagingSelect.Add(sql);
if (hasOffset)
{
pagingSelect.Add(" ) row_ where rownum <=").AddParameter().Add(") where
rownum_ >").AddParameter();
}
else
{
pagingSelect.Add(" ) where rownum <=").AddParameter();
}
if (isForUpdate)
{
pagingSelect.Add(" for update");
}
return pagingSelect.ToSqlString();
}
2009/7/10 Josh Pearce <[email protected]>
>
> Hi,
>
> I am having trouble with Oracle paging, and I am trying to find the
> source files affected by this ticket:
> http://nhjira.koah.net/browse/NH-1637
> ,but I can't see where the function GetLimitString has changed in the
> Oracle Dialect.
>
> Thanks.
>
> >
>
--
Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---