function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
webdevwebdev 

Perl code sample for querymore

Does anyone have working sample code for querymore in perl?
stanfishstanfish
This code seems to work though I haven't spent much time examining the results: 
 
# First the initial query to get the first batch of results
$sfresult = $sforce->query('query'=>'YOUR SOQL STATEMENT HERE');

# Handle each returned row
foreach $row ($sfresult->valueof('//queryResponse/result/records'))
{
    processRow($row);
}
 
# Get the rest of the data using queryMore
while ($QL = $sfresult->valueof('//queryLocator'))
{
    $sfresult = $sforce->queryMore('queryLocator'=>$QL);
    foreach $row ($sfresult->valueof('//queryMoreResponse/result/records'))
    {
        processRow($row);
    }
}
 
sub processRow
{
    $record = shift;
    # do something with the record