in reply to Replacing a ' in a string
As an added benefit, you have to prepare your SQL statement only once, because it no longer contains any variable data. You just execute() the prepared statement with the new data for the placeholders.
The code could look a bit like this — obviously, you must merge it in with what you've got, at the appropriate places:
and foreach record:my $sql = "INSERT INTO mf_forms (CLIENT, RECORD, CONTROL, CUSIP, FROMA +CCT, F_IND, TOACCT, T_IND) VALUES (?,?,?,?,?,?,?)"; my $sth = $dbh->prepare($sql);
p.s. You may just as well call execute() with an array containing the data.$sth->execute($CLIENT, $RECORD, $CONTROL, $CUSIP, $FROMACCT, $F_IND, $ +TOACCT, $T_IND);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Replacing a ' in a string
by dragonchild (Archbishop) on Feb 06, 2003 at 16:43 UTC |