[freetds] FreeTDS no longer returns metadata properly?

Igor Chudov igor at chudov.com
Sun Apr 20 12:16:36 EDT 2008


Big thanks to authors and maintainers of freetds.

I have a perl scipt using DBI and FreeTDS. It connects to a Microsoft
server, and makes a "select *" query. Then it analyzes results
metadata and tries to figure out types of columns.

    $sth = $remote_dbh->prepare( "select * from $table" )  
      || report_error_and_die "Cannot query Mike's database (prepare)";  
    $sth->execute() || report_error_and_die "Cannot query Mike's database (execute)"; 
 
    my $col_names = $sth->{NAME};  
    my $col_types = $sth->{TYPE};  
 
Col_names array ref is great and contains the list of column names. 

col_types array ref, which used to work and contained valid type
numbers, no longer works on 64 bit ubuntu Hardy. Instead of valid
types, it contains a bunch of zeroes (as many as columns).

Can anyone help me get the right type numbers?

i



More information about the FreeTDS mailing list