There's the issue. I was using a primary key from the database as the hash key 
so I assumed there were no duplicates. Just did a manual query and there are 
duplicate ids, must be my query or the database.

Thank you!

-----Original Message-----
From: Martin J. Evans [mailto:boh...@ntlworld.com] 
Sent: Friday, May 15, 2015 10:13 AM
To: Kyle A. Hamilton; 'dbi-users@perl.org'
Subject: Re: dbi selectall_hashref drops results

On 15/05/15 15:56, Kyle A. Hamilton wrote:
> I ran into an issue where dbi’s selectall_hashref will drop results 
> returned from the database. If I change the query to count the number 
> of results returned, it returns 96, but I am missing some records that 
> I get when I manually query the database. If I use selectall_array ref 
> and loop through the results, I get the same data as I get from 
> manually querying the database. I can provide the proprietary code as 
> an example, just want to make sure this is the correct place to submit 
> this.

For selectall_hashref you have to give it a key field. If that field is not a 
unique key you will lose rows.

Martin

Reply via email to