Update:
I have used bobr's solution, but I found another problem, the returned name is a user defined type name instead of a regular data type. For example using "sp_columns" I can see a column's type is float, but the type_info() return is ABC_TY(which is a user defined type). I am using Sybase, anyone encountered similar problem?
I am using DBI and the following code to get the table column type:
my $sql = "SELECT * FROM $tablePath WHERE 0 = 1"; my $sth = $dbh->prepare($sql); $sth->execute(); $sth->finish(); my $all_types = $sth->{TYPE};
The returned value is a reference to an array which contains many integers indicating the data type of each column, these integers are not useful unless I turn them into names, anyone knows how can I turn these data type integers into more descriptive names?
arturo (Vicar) had mentioned this in http://www.perlmonks.org/?node_id=184120, but I still don't find any detail document.
Thanks a lot!
In reply to How to map the coloumn type integers to names in DBI by littlehorse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |