July 1999
Intermediate to advanced
502 pages
19h 52m
English
Msql::Statement::as_string
$formatted_table = $statement_handle->as_string;
Msql::Statement::as_string returns the data
contained in the statement handle in a neatly formatted ASCII table.
The table is similar to the ones used by the
msql monitor. The pmsql
program supplied with the Msql.pm module uses
this function to generate its tables.
use Msql;
my $db = Msql->connect;
$db->selectdb('mydata');
my $query = "SELECT * FROM mytable";
my $mytable_output = $db->query($query);
print "My Table:\n", $mytable_output->as_string;
# This prints the entire table in a fashion much cleaner than the
# Msql::Statement::fetchhash example.Read now
Unlock full access