Bob Kleemann rkleeman at
Fri Jul 20 12:36:25 CDT 2001

On Fri, 20 Jul 2001, Joel Fentin wrote:

> ~sdpm~
> The following snippet is to stick around until rl = 0. It lies and passes
> through even though rl = 1. I've tried many ways to do this. They all lie.
> At the meeting, someone suggested FINISH. I have not found a way to use
> FINISH that doesn't bomb.

finish only works on statement handles.  To get a statement handle for the
code you are using below, you'd want to do the following:

my $sth = $dbh->prepare("UPDATE $TableName SET rl = ? WHERE ID = ?");
$sth->execute(0, $ID);

And for the select it would look like:

my $sth = $dbh->prepare("SELECT COUNT(*) FROM $TableName WHERE ID = ? AND !rl");
my ($rv) = $sth->fetchrow_array();

Of course I'd only recommend making these changes if you need/want the
extra functionality/error handling that can be achieved with them. 
Otherwise I'd stick with your method witht the change noted below. 

> ==========================
>   my ($rv);
>   $dbh->do("UPDATE $TableName SET rl = 0 WHERE ID = $ID");#reset rl
>   do
>     {

Put parenthesis around the $rv in this statement:

($rv) = $dbh->selectrow_array("...");

If you don't then $rv is going to have the number of elements in the array
that selectrow_array returned.

>     $rv = $dbh->selectrow_array("SELECT COUNT(*) FROM $TableName WHERE ID =
> $ID AND !rl");# examine rl
>     }
>   until $rv;
>   }
> --
> Joel Fentin    tel: 760-749-8863    FAX: 760-749-8864
> email: joel at     web:


The posting address is: san-diego-pm-list at

List requests should be sent to: majordomo at

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at> .
This is the general rule for most mailing lists when you need
to contact a human.

More information about the San-Diego-pm mailing list