Name

Msql::Statement::table

Synopsis

@tables  = $statement_handle->table;

Msql::Statement::table returns a list of the tables associated with each of the columns of data contained in the statement handle. When called in a scalar context, the function returns a reference to an array. (See Msql::Statement::isnum for an example of how to use the array reference.) One entry is present for each column of data even if only one table was used in the query. As a side effect, the scalar value of the array returned by $statement_handle->table is the same value as $statement_handle->numfields.

Example

use Msql;
my $db = Msql->connect;
$db->selectdb('mydata');
my $output = $db->query('select myothertable.name, myothertable.date,
   mythirdtable.name from myothertable, mythirdtable where myothertable.name
   = mythirdtable.name');

my @tables = $output->table;
# @tables now contains ('myothertable', 'myothertable', 'mythirdtable')

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.