% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::Cursor - Iterator for querying large data sets
use FS::Cursor;
my $search = FS::Cursor->new('table', { field => 'value' ... }); while ( my $row = $search->fetch ) { ... }
Constructs a cursored search. Accepts all the same arguments as qsearch, and returns an FS::Cursor object to fetch the rows one at a time.
DBH may be a database handle; if so, the cursor will be created on that connection and have all of its transaction state. Otherwise a new connection will be opened for the cursor.
Fetch the next row from the search results.
Replace all uses of qsearch with this.
Still doesn't really support MySQL, but it pretends it does, by simply running the query and returning records one at a time.