From: w_a_x_man Date: 2010-12-28T02:55:16+09:00 Subject: Re: Find not working On Dec 27, 11:30 am, Shandy Nantz wrote: > Hi all, > > I have this ruby script that simple rips through a CSV file, retrieves a > username and then search my database for that user and any associated > data. My problem is that the query I'm using to find my users isn't > working even though this is pretty basic stuff that I am trying to do. > My query looks a little something like this: > > @finduser = User.find(:first, :conditions => ['upper(username) = ?', > x[11].to_s.upcase]) > > x[11] is the field in my csv file that has the  username, other then > that this is a simple script, but the user is never being found even > though ActiveRecord has the correct host and adapter information. My > question is there anyway to output the query string from my object or > the query that is being built? The only thing I can think of is that the > query is not being built correctly since for some of my test users the > correct username is there and should be found. Thanks in advance and > happy holidays, > > -S > > -- > Posted viahttp://www.ruby-forum.com/. This is not a Rails forum.