in reply to Re: Re: Re: Placeholders, safety and the relative unimportance of efficiency
in thread SQL in Perl and setting variables

I guess the table doesn't have a primary key? Also you should use RaiseError or else check the status of every DBI statement. Anyway you're probably being redundant by specifying 'where rowid = .. and exe_c = ..'. And you can still use placeholders(psuedocode ahead):
my $dbh = DBI->connect('...', 'user','passwd', {PrintError=>0, RaiseError=>1}); my $sql = <<EOT; select ... from .. where exe_c = 'N' EOT my $sel_h = $dbh->prepare($sql); $sql = <<EOT; update ... set exe_c = 'N' where rowid = ? EOT my $upd_h = $dbh->prepare($sql); $sel_h->execute; $sel_h->bind_columns(...); while ($sel_h->fetch) { ... $upd_h->execute($rowid); } $dbh->disconnect;
------------
ooo  O\O  ooo tilly was here :,(
  • Comment on Re: Re: Re: Re: Placeholders, safety and the relative unimportance of efficiency
  • Download Code