DBD DBI
Posted in 1999
Hi,
somebody told me that with DBD DBI I can see the query plan of a sql
statement when I just prepare the statement.
I tried it but it didn't work.
#!/opt/perl5/bin/perl
$database = $ARGV[0];
if ($database eq "") {print "Datenbank Name fehlt\\n";
exit(1)
}
use DBI;
$dbh = DBI->connect("dbi:Informix:$database", '', '', { AutoCommit => 0,
PrintError => 1 }) || die "Can't connect to $database: $DVI::errstr";
$sth = $dbh->prepare( q{ set explain on });
$sth->execute;
$sth = $dbh->prepare( q{
select * from tdb where nummer = ?}) || die "Can't preparestatement: $DBI::errstr";
$rc = $dbh->disconnect;
When I execute the prepared statement I get the query plan. What's wrong?
Thanks in advance
Monika Rabold
Bull GmbH Langen
Tel: 06103/761-4225
email: mora@swh600.langen.bull.de