This method is typically most useful for non-SELECT statements that either cannot be prepared in advance (due to a limitation of the driver) or do not need to be executed repeatedly. It should not be used for SELECT statements because it does not return a statement handle (so you can't fetch any data). #### #!/usr/bin/perl use strict; use warnings; use Test::More; use DBI qw/:sql_types/; my $dsn = 'DBI:mysql:database=DB'; my $dbh = DBI->connect($dsn, 'user', 'psw', {RaiseError => 1}); my $sth = $dbh->prepare('SELECT "Hello World"'); $sth->execute(); printf "SELECT rows = %d\n", scalar $sth->rows; printf "\t(@$_)\n" for $sth->fetchrow_arrayref; my $rows = $dbh->do('CALL DebugMe(@dmvar)') or die $dbh->errstr; my ($v) = $dbh->selectrow_array('SELECT @dmvar'); is( $dbh->errstr , undef , 'SELECT(@dmvar) without error' ); is( $v , 'HELLO' , 'DebugMe(@dmvar); SELECT @dmvar' ); done_testing(); $sth->finish; __END__ $ perl mysql.pl SELECT rows = 1 (Hello World) ok 1 - SELECT(@dmvar) without error ok 2 - DebugMe(@dmvar); SELECT @dmvar 1..2