Find/Search Results Capped at 200

Questions, tips and tricks and techniques for scripting in Servoy

Find/Search Results Capped at 200

Postby kwpsd » Fri Jun 22, 2012 2:27 am

Version: 6.0.6 - build 1232

A table has 1091 records. In this table, there are 971 records whose column named 'period' contain an empty string (''). The following find/search code is used to extract the 971 records (numbers verified using SQL Explorer):

Code: Select all
    var fs = databaseManager.getFoundSet( databaseName, tableName )
   
    if ( fs.find() )
    {
        fs.period = ''
       
        var recordCount = fs.search()
       
        <remainder of code>
    }


The variable 'recordCount' always returns a value of 200. Should it not be returning the number of records found (971)?

Any help or suggestions appreciated...thanks!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: Find/Search Results Capped at 200

Postby ptalbot » Fri Jun 22, 2012 3:27 am

As usual to know the exact number of records in the foundset, you need to use databaseManager.getFoundsetCount(fs);
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Find/Search Results Capped at 200

Postby kwpsd » Fri Jun 22, 2012 4:22 am

I tried that but was getting the full record count of 1091, so I thought something changed. Now, at home, after restarting my computer, I tried it again, and it worked. Some days...

Thanks for reiterating the .getFoundsetCount() yet one more time! <grin>
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: Find/Search Results Capped at 200

Postby ptalbot » Fri Jun 22, 2012 5:05 am

Maybe you did a .getFoundsetCount() on the foundset before the search which is why it was returning the full count?
Anyway, glad it works for you now! :)
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Find/Search Results Capped at 200

Postby m.vanklink » Fri Jun 22, 2012 8:08 am

I would use this:

Code: Select all
fs.period = '^='

This will search for fields containing null or empty string
Michel van Klink
Vision Development
m.vanklink
 
Posts: 70
Joined: Thu Feb 23, 2012 9:15 am
Location: The Netherlands

Re: Find/Search Results Capped at 200

Postby kwpsd » Fri Jun 22, 2012 8:10 pm

Patrick...your guess was close. I discovered that I had two expressions in the debugger; one for a variable based on the foundset count and one evaluating the getFoundsetCount() directly, and I was using the wrong one in my analysis.

Michel...thanks for the tip!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA


Return to Methods

Who is online

Users browsing this forum: No registered users and 14 guests