List:General Discussion« Previous MessageNext Message »
From:Christopher R. Jones Date:June 6 2000 5:28pm
Subject:Re: DBD::mysql prepared statements
View as plain text  
If DBD:MySQL does not support "prepare", why has this been working for me:
my $sql_bldgs = $dbh->prepare($sql_query);
$sql_bldgs->execute;

>Hi All,
>
>In an articel (The Perl Journal #14 pp. 60-62) I've read that there is a
>speedup of ~30% when using DBI prepared statments like
>
>$sth = $dbh->prepare("insert into my_table values(?,?,?)");
>foreach $data (@all_data){
>         $sth->execute($data->[0], $data->[3], $data->[2]);
>}
>
>compared to
>
>foreach $data (@all_data){
>         $dbh->execute(qq/insert into my_table values ($data->[0],
>$data->[3],
>                        $data->[2])/);
>}
>
>although mysql doesn't support prepared statements. Why then should the
>first solution be quicker?
>
>(hope this posting is not too much off topic ... )
>
>         thanks a lot,
>
>         Arne
>
>--
>Arne Mueller
>Biomolecular Modelling Laboratory
>Imperial Cancer Research Fund
>44 Lincoln's Inn Fields
>London WC2A 3PX, U.K.
>phone : +44-(0)207 2693405      | fax :+44-(0)207-269-3534
>email : a.mueller@stripped | http://www.bmm.icnet.uk
>
>--
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/php/manual.php3" before
>posting. To request this thread, e-mail mysql-thread39493@stripped
>
>To unsubscribe, send a message to:
>     <mysql-unsubscribe-cj=interlog.com@stripped>


Christopher R. Jones, P.Eng.
14 Oneida Avenue
Toronto, Ontario M5J 2E3
Tel. 416 203-7465
Fax. 416 203-3044
Email cj@stripped


Thread
DBD::mysql prepared statementsArne Mueller6 Jun
  • Re: DBD::mysql prepared statementsChristopher R. Jones6 Jun
    • Re: DBD::mysql prepared statementssasha7 Jun
      • Re: DBD::mysql prepared statementsTim Bunce7 Jun