Statement help
From: Ing. Branislav Gerzo (2ge_at_2ge.us)
Date: 02/07/05
- Next message: Juan Jose Natera: "NLS issues if using DBD::Oracle from mod_perl2"
- Previous message: Michael A Chase tech: "Re: What happened to dbish?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 7 Feb 2005 10:31:49 +0100 To: dbi-users@perl.org
Hello,
I have in mysql table "kl": ID, value, flow
now, when I run in mysql:
UPDATE kl SET value = 10, flow = value - 10 where ID = 5;
it works. But when I write that in script:
my $sth = $dbh->prepare_cached("UPDATE kl SET value = ?, flow = value - ? WHERE ID = ?");
$sth->execute( 10, 10, 5 );
I want to have prepared $sth, because I call execute in for cyclus.
it doesn't update column flow, it is always 0 (I want to know
difference between current value and value stored in db). Why it is
so?
Thanks a lot.
- Next message: Juan Jose Natera: "NLS issues if using DBD::Oracle from mod_perl2"
- Previous message: Michael A Chase tech: "Re: What happened to dbish?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|