in reply to Datatype of fetch'ed columns using Perl-Sybase

Have a look at the "catalog" functions of DBI. They return the database type of columns for a given query.

  • Comment on Re: Datatype of fetch'ed columns using Perl-Sybase

Replies are listed 'Best First'.
Re^2: Datatype of fetch'ed columns using Perl-Sybase
by perl@1983 (Sexton) on Jul 03, 2012 at 15:23 UTC
    Thanks for the quick reply Corion! I went through those functions and if I understood correctly, they would return the datatype as a number representing their ISO counerpart. Is it possible to see the actual Sybase datatype (instead of number)?

      You could certainly translate them yourself:

      First, create your translation table (ficticious data, of course):

      my %translation_table = ( 1=>"bool", 27=>"char", 13=>"dec", 34=>"nul", 55=>"etc...", );

      Then, using the value from catalog functions, select and then print (or say) the appropriate data-type-word to your output.