in reply to Re^3: Perl Code Efficiency Issue
in thread Perl Code Efficiency Issue
Erm ... CONVERT is a SQL function, not a Perl one, likewise the money is a SQL constant, not a Perl one. And is you enclose a variable in singlequotes you do not get the value of the variable inserted into the string, but the dollar and the name of the variable. I believe you meant:
Now, while it might make sense to name the statement handle $sth2, it definitely does not make sense to name variables $ABC1, $ABC2, ... It should be an array!$sql_net="UPDATE today_records SET current_prem = CONVERT(money, ?) WHERE account_num= ? AND type='OK'"; my $sth2 = $dbh_2->prepare($sql_net); ... $sth2->execute( $ABC7, $ABC2) || die $sth2->errstr;
BTW, are you sure the CONVERT() is needed?
|
|---|