in reply to Perl Beginners problem with DBI
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl Beginners problem with DBI
by Anonymous Monk on Mar 17, 2004 at 14:49 UTC | |
by jeffa (Bishop) on Mar 17, 2004 at 15:10 UTC | |
by dragonchild (Archbishop) on Mar 17, 2004 at 17:52 UTC | |
by zigdon (Deacon) on Mar 17, 2004 at 16:15 UTC | |
by rdfield (Priest) on Mar 17, 2004 at 15:06 UTC |