Dieter
> Hello,
>
> i am looking for a complete list of the integer values and their
> respective data types returned from the TYPE statement handle
> attribute. I followed both links in the 'Programming the Perl DBI
> book, but they did not lead to any results. I am interested in all
> MySQL data types, especially in all text data types (There are no
> values for text data types in the book).
>
> Any help (link) would be appreciated.
>
read about the type_info_all() method in the DBI docs.
to dump it all out in a readable form, get yourself a database handle
and run the following code (tested with DBD::ODBC and MS Access on
win2k):
<code_snippet>
for (@{$dbh->type_info_all}) {
print '|';
if (ref $_ eq 'HASH') {
printf (("%20s |" x scalar ( keys %$_ )) . "\n",
(sort {$_->{$a} <=> $_->{$b}} keys %$_)
);
print '-' x ((scalar keys %$_) * 22), "\n";
}
else {
printf (("%20s |" x scalar @$_ ) . "\n", @$_) if ref $_ eq
'ARRAY';
}
}
</code_snippet>
The resulting table is *rather wide*, so you should have a text
editor which can scroll horizontally.... -:)
HTH
Bodo