Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Implement cursors #2

Open
vti opened this issue Sep 7, 2017 · 0 comments
Open

Implement cursors #2

vti opened this issue Sep 7, 2017 · 0 comments
Assignees

Comments

@vti
Copy link
Owner

vti commented Sep 7, 2017

my $sql = "SOME QUERY HERE";
$dbh->do("DECLARE csr CURSOR WITH HOLD FOR $sql");
my $sth = $dbh->prepare("fetch 100 from csr");
$sth->execute;

while(my $ref = $sth->fetchrow_hashref()) {     
    //... - processing here
    if ($count % 100 == 0){             
        $sth->execute;
    }
}
@vti vti self-assigned this Sep 7, 2017
@vti vti added the enhancement label Sep 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant