And be sure that you connect with RaiseError set to true while you are at it:$dbh->do( 'UPDATE INV SET SALESMAN = ? WHERE CODE = ?', undef, $SALESMAN, $CODE, );
my $dbh = DBI->connect( $data_source, $username, $pass, {RaiseError => 1}, );
UPDATE:
Now i see the real culript:
You need to quote that first!my $updy="Y"; $dbh->do("UPDATE INV SET SOLD=$updy ... ");
or just use placeholders instead and let DBI do the quoting:$dbh->do("UPDATE INV SET SOLD='$updy' ... ");
$dbh->do("UPDATE INV SET SOLD = ? WHERE CODE = ?", undef,$updy,$CODE);
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Perl Beginners problem with DBI
by jeffa
in thread Perl Beginners problem with DBI
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |