Tatnall has asked for the wisdom of the Perl Monks concerning the following question:
Using the tie gave me the exact same results as not using it, which lead me to believe that the order dbi stores the hash might be out of my control. An example of the more complicated statement, I'd like to use:use strict; use Data::Dumper; use DBI qw(:sql_types); use Tie::IxHash; tie my %results, "Tie::IxHash"; ... connect to db .... my $stmt = qq~SELECT * FROM registrants WHERE registrant_id = ?~; %results = % { $dbh->selectrow_hashref($stmt, undef, $registrant_id) } +;
Has anybody run across this before?my $stmt = qq~SELECT * FROM registrants, hotels, cadavers WHERE re +gistrants.registrant_id = ? AND registrants.registrant_id = hotels.re +gistrant_id~; %results = % { $dbh->selectrow_hashref($stmt, undef, $registrant_i +d) };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Maintaining column name and column order using DBI
by bobf (Monsignor) on Mar 15, 2006 at 18:17 UTC | |
by Tatnall (Beadle) on Mar 15, 2006 at 18:58 UTC | |
|
Re: Maintaining column name and column order using DBI
by blokhead (Monsignor) on Mar 15, 2006 at 18:18 UTC | |
|
Re: Maintaining column name and column order using DBI
by jZed (Prior) on Mar 15, 2006 at 17:41 UTC | |
by Tatnall (Beadle) on Mar 15, 2006 at 17:49 UTC | |
|
Re: Maintaining column name and column order using DBI
by kwaping (Priest) on Mar 15, 2006 at 19:23 UTC |