|
Posted by Mike Pomraning on September 16, 2007, 4:48 pm
Please log in for more thread options
dtshedd@yahoo.com wrote:
> I am using the following code adapted from
http://www.roth.net/perl/odbc/docs/object/
> to try and capture the field names of a database. The odd thing is
> that the fields names are not returned in the order they appear in the
> table. I know from the aforementioned site there is a sort option but
> the order of the field names in the table are not in alphabetical
> order. any way to get the returned field names in the order in which
> they appear in the Access database?
Please read "perldata". Perl's hashes aren't ordered, so this behavior
is, to my mind, expected. Also, the sort option you refer to seems
rather to be the sort function ("perldoc -f sort").
Now, Win32::ODBC, the module in question, doesn't seem guarantee the
order of db field names in any case. See its documentation for the
FieldNames() method, for instance.
Finally, ask yourself if the "physical" order of the columns really
matters. As long as you can discriminate field 'foo' from field 'bar',
what does their internal database layout matter?
Regards,
Mike
|