RE: selectall_hashref() when key field not unique
Ron Reidy wrote:
>select 5 as a, 6 as b from dual union select 5 as a, 7 as b from dual;
>Two rows returned.
Indeed, two rows are returned from the database, and DBI throws away
one of them when you use selectall_hashref() giving 'a' as the key
field. Try the example program I posted.
This is not a bug in DBI, it's just not documented what exactly it's
meant to do.
--
Ed Avis <avised@xxxxxxxxx>
Relevant Pages
- RE: fetchrow_array performance
... I agree - set RasieError. ... it is impossible to tell what is going on in the database without a 10046 trace. ... You aren't error checking your dbi statements - do you have RaiseError ... sender of the delivery error by replying to this message, or notify us by ... (perl.dbi.users) - Re: Evaluated "require $database" not found.
... DBI Error 1046: No database selected ... What I have found is that if the spaceare removed as per the correct syntax, then the DBI_errorhandler will trap and report a connection failure if a non-existent database is specified, as per this example: ... This requires that you first have an installation of mysql setup on a host ... (perl.dbi.users) - Re: Cant call method "prepare" on an undefined value
... Somehow you managed to have an undefined value instead of a DBI database handle in front of ->prepare, which is burried deep inside Oraperl.pm. ... Oracle HTTP Server at Server B. Both server are Solaris server. ... I have installed DBI and DBD into Server B and setup the oraperl in my perl script. ... (perl.dbi.users) - Balasan: RE: Balasan: RE: Balasan: RE: Balasan: RE: cant execute "use $database"
... dictionary of the each database of my MSSQL. ... to load it -- DBI will load it for you. ... Subject: Balasan: RE: Balasan: RE: Balasan: RE: ... (perl.dbi.users) - Re: Evaluated "require $database" not found.
... I'm familiar with error trapping as described in "perldoc DBI" - ... Transactions are a fundamental part of any robust database system. ... Ron Wingfield ... of how you do a simple DBI connection. ... (perl.dbi.users) |
|