in reply to DBI column_info question

It's a bug in DBD::mysql. If you got column info on the whole table, it would correctly return the position of each column. But since you are only getting info on one column at a time, the count starts with '1' each time. In the code, the ordinal position is a simple incremented variable for each column returned.

Replies are listed 'Best First'.
Re^2: DBI column_info question
by FryingFinn (Beadle) on Mar 26, 2015 at 16:54 UTC
    thanks for pointing me in right direction. changed my code to...
    my $sth = $dbh->column_info(undef, undef, 'table1', "%"); my $col_info = $sth->fetchall_hashref('ORDINAL_POSITION');
    which gives exactly what I wanted.

    "thx" x 100