Here's the code that's failing:
my $sth_exists = $dbh->prepare( "
LOCKING DBC.Users FOR ACCESS
SELECT UserName
FROM DBC.Users
WHERE UserName = ?;\n") or die "Prepare to check for existence failed! $!";
foreach (keys %names) {
$sth_exists->bind_param(1,$_) or die "No bind param for existence: $!";
$sth_exists->execute() or die "No execute for existence: $!";
# More stuff, but there's where I get the error.
}
The first time through the loop, everything is copacetic, but on the
second time, I get an SQL-24000 error, invalid cursor state. Now, why
would it do this on the second time through the loop, but not on the
first?
John A