Below is taken from: http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm
Also look at: http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html Prepared statement support (server side prepare) To use server side prepared statements, all you need to do is set the variable mysql_server_prepare in the connect: $dbh = DBI->connect( "DBI:mysql:database=test;host=localhost:mysql_server_prepare=1", "", "", { RaiseError => 1, AutoCommit => 1 } ); To make sure that the 'make test' step tests whether server prepare works, you just need to export the env variable MYSQL_SERVER_PREPARE: export MYSQL_SERVER_PREPARE=1 Test first without server side prepare, then with. On 7/10/05, Mads N. Vestergaard <[EMAIL PROTECTED]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hey Peter, > > Are you sure about that? > As far as I understand, what you say you can't do, is to have two > prepares for example: > > my $dbh = DBI->connect("dbi:mysql:database","user","pass"); > my $foo = $dbh->prepare("SELECT * FROM ....."); > my $bar = $dbh->prepare("INSERT INTO ....."); > $foo->execute(); > $foo->finish(); > $bar->execute(); > $bar->finish(); > > At least that works for me. > > Sorry if I misunderstood you. > > > Mads > > Peter Rabbitson wrote: > |>I'm sure others will give you more informed answers.. But why can't > |>you create multiple statement handlers under the same connection? > |> > | > | > | Because you can't. One connection holds only one prepared statement (at > | least in MySQL). If you prepare $statement2 on the same $dbh, > | $statement1 automatically gets invalidated. Clinically proven :) > | > | Peter > | > | > > - -- > Mads N. Vestergaard - http://rwxr-xr-x.dk > Interested in Open Source, and web application development > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQFC0Ukt7WOaPMd53OMRAvcCAJ0Y/kCn1Oh67D3AUrCfpq7ihBOu8QCeO/SC > JMvYjVK+8naZfgReXn13AQU= > =psBJ > -----END PGP SIGNATURE----- > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>