From: gregarican Date: 2006-11-16T05:25:07+09:00 Subject: Re: Assoc method on large array You got it. In the case of trying to sort things based on a particular field I converted them to the same type since there was a bug where this wasn't always 100% consistent. After doing so then the sorting worked like a champ. The only other stumbling block was that within the SQL recordset array each record was actually a DBI::Row object and not an array unto itself. I should've known this but hadn't looked under the hood of the DBI stuff for awhile. After converting these DBI::Row objects to arrays then I could check things with the assoc method. So things aren't broken after all! Paul Lutus wrote: > gregarican wrote: > > > I didn't let the DB do the selection because I was querying different > > databases residing on different servers and combining the results in a > > way that I didn't feel like jumping through SQL hoops for. Since I like > > coding in Ruby better than coding in SQL I figured I'd let Ruby do the > > heavy lifting. Looking at it, a Hash object would be better suited for > > some of this work. Next time I will utilize this type of object. > > In the case of records from different databases on different servers, I > strongly suggest that you test each field of each record for agreement with > what the field should contain. This may solve the original problem of > mysterious behavior on large data sets -- it may have been an unexpected > field content, one that wasn't what it should have been. > > Simply go through each field and test that it is what you expect, and > convert it if it isn't. This will take some time, but the entire procedure > is failing right now, and that is worse IMHO. > > -- > Paul Lutus > http://www.arachnoid.com