Hola, Nuno!
Unfortunatelly, I couldn't see your sample at work. But for theoretical purposes it should be enough.
I do the same thing as you do, but it ALWAYS starts from the FIRST record.
I'll insert here my piece of code, so that you can see if I had done something stupid.
ClassMethod SelectFromScrollable(query As %String)
{
Set resultSet = ##class(%ScrollableResultSet).%New( "%DynamicQuery:SQL" )
Set resultSet.MaxRows = 100
Do resultSet.Prepare( query )
Do resultSet.Execute()
//Write !, "Status: "_resultSet.CurrRowSet( 200000 )
Set resultSet.CurrRowSet = 200000
While ( resultSet.Next() ) {
Write !, "ID: "_resultSet.Data( "ID" )_" / "_resultSet.CurrRow
//Write !, "ID: "_resultSet.%Id()_" / "_resultSet.CurrRow
}
Write !, resultSet.Count()_ " records found"
if resultSet.Close() {
Set resultSet = ""
}
//
Kill resultSet
}This method doesn't make what it's suppose to:
1) It finds me 131 records, not 100 as I specified. This is buggy, but with some "for i=1...100" it can be solved.
2) The %Id() method doesn't work in any way, I alway become an empty string back.
3) The CurrRow begins 1st postion, not from position 200000, as I said before.
Somehow I got the idea that this ScrollableResultSet is not 100% developed and there are some bugs in it. Please forget/correct me if I am wrong!
I did another example, with the ResultSet class which works correctly but it's too slow.
By the way, does anyone have another sample, so that I can see something working?
Until now, the samples from the Intersystems presentation were pretty good, but still to slow even on a local machine.
Thank you for any ideas or suggenstions!
Marius Gabor
On Thu, 22 Jul 2004 19:23:33 +0100, Nuno Canas <[EMAIL PROTECTED]> wrote:
Marius,
Look at http://www.mgateway.com/utility.htm
There is an example (Simple CSP Navigation) that uses %ScrollableResultSet.
The csr:Rule should be in a diferent file, but the PrintPage Method is quite what you need/want.
Regards Nuno
Marius Gabor wrote:
Hi there! I did some sample with ScrollableResultSet. Unfortunatelly, I couldn't set the currRow in any way. I tried resultSet.CurrRow = rowNr and CurrRowSet( rowNr ). It begins always from the first row in the result set. How can I move directlly to the rowNr-th record? Many thanks in advance! Marius Gabor
