RE: Meaning of TYPE_NAME in type_info() output

"Avis, Ed" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase,gmane.comp.lang.perl.modules.dbi.general
Message-ID <B6950B05C2FB1A418290414131B118B964C536@EXLN1-VS1.london.kbcfp.com>
Michael Peppler wrote:

>>Currently if I make a user-defined type on Sybase and use it for some
>>column C of a table T, then for 'SELECT C FROM T' DBD::Sybase gives me
>>the name of the user type.

>I just tried it, using a user-defined type mapped to varchar(30), and
>type_info() returns "char" (which is correct).

Hmm, I spoke too soon.  In fact Sybase isn't giving me a user-defined
type of the column, but some other crap.

    my $dbh
      = DBI->connect('dbi:Sybase:server=MY_SERVER;database=mydb',
                     'myuser', 'mypass',
                     { RaiseError => 1, AutoCommit => 0 });
    $dbh->do('create table #foo (c int)');
    my $sth = $dbh->prepare('select c from #foo');
    execute $sth;
    my $data = $sth->fetchall_arrayref;
    print $dbh->type_info($sth->{TYPE}->[0])->{TYPE_NAME}, "\n";

This prints 'event_type_t', although the column was clearly defined as
int.  However with a different database on the same server (eg master),
it prints correctly 'int'.  So there is some weirdness in my database.

-- 
Ed Avis <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.