in reply to Update while reading Database
The official DBI way of doing this might look like this:
Note that some database servers may open a second connection for you anyway when creating the second statement handle..my $sth = $dbh->prepare("select name from file_table where <some condi +tion>"); my $upd_sth = $dbh->prepare("update file_table set timestamp = ? where + name = ?"); while(my $d = $sth->fetch) { # do the upload, etc; # if all is well: $sth_upd->execute(time, $d->[0]); }
Depending on the database server there may be different ways of doing this, as well.
Michael
|
|---|