Name

Msql::Statement::isnum

Synopsis

@numbers  = $statement_handle->isnum;

Msql::Statement::isnum returns a list of boolean values indicating if each of the columns of data contained in the statement handle is a numerical value. When called in a scalar context, the function returns a reference to an array. Numerical values include types, such as `INT' and `REAL', but do not include a `CHAR' or `TEXT' field that contains numbers.

Example

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

print "Name is a number" if $output->isnum->[0];
print "Date is a number" if $output->isnum->[1];

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.