Subject: | the {TYPE} attribute of statement handles is not numeric |
/home/merijn 108 > perl -MDBI -wle'$_=DBI->connect
("dbi:Pg:",undef,undef)->prepare("select * from foo");$_->execute;print
$_->{TYPE}[0]'
4
/home/merijn 109 > perl -MDBI -wle'$_=DBI->connect
("dbi:SQLite:dbname=foo",undef,undef)->prepare("select * from foo");$_-
Show quoted text
>execute;print$_->{TYPE}[0]'
integer
/home/merijn 110 >
->{TYPE} is supposed to be numeric (the ANSI value of the type)
$dbh->type_info ($sth->{TYPE})->{TYPE_NAME} should be available to
return the string representation of that type for the current database
type
Oracle, PostgreSQL, Unify and CSV all do it right
DBI docs say:
For example, to find the type name for the fields in a select statement
you can do:
@names = map { scalar $dbh->type_info ($_)->{TYPE_NAME} } @
{ $sth->{TYPE} }