default column values from DBI (DBD::mysql)

default column values from DBI (DBD::mysql)

am 09.12.2003 00:00:51 von apv

After looking through the PODs, online, and the code a bit, I think
it's not possible to get the default value for a column directly from
DBI (and MySQL in my case), is that right?

looks like it has to be this sort of thing:
my $data = $dbh->selectall_arrayref(qq/SHOW COLUMNS FROM $table/);
for my $row ( @{ $data } ) {
print "$row->[0] -->> ", $row->[4] || 'NULL', "\n";
}

I'm writing to check because I'd love to find out it's already
somewhere in the statment handle attributes instead (or perhaps to beg
Rudy Lippan to consider slipping it in if it's not there now):
I tried this one: $sth->{COLUMN_DEF} because it appears in the raw
module code but it croaks:
Can't get DBI::st=HASH(0x299388)->{COLUMN_DEF}: unrecognised attribute
at...

Thank you!
-Ashley


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org