On Feb 27, 6:50 pm, Greg Hauptmann <[email protected]>
wrote:
> 2009/2/28 Matt Jones <[email protected]>
>
> > Google's formatting
> > engine chews up spaces pretty bad, but are you *sure* you've got the
> > same number in
> > that second query?
>
> It should be as I used the save copy/paste of the string.  I take your point
> re the standard output and what could happen there, however the bottom line
> seems to be when I use exactly the same string in the "find" method it
> doesn't find it, whereas if I use it in the "find_by_sql" method it does
> find the row.
>
> I wonder how I could confirm the exact SQL that is getting issued to the DB
> without having to worry about any changes to it whilst it is being
> displayed.  Perhaps I'll try to switch on logging in mysql and monitor at
> that point?
>

That would be a good idea. You might also want to try some queries
like:

AccountItem.find(:all, :conditions => ["description LIKE ?", 'FISHERS
IGA%'] )

with progressively longer substrings to see if any of those work.

> > On an unrelated note, are you really sure you want a fixed-width space-
> > delimited field in the DB?
> > Wouldn't it be easier to use multiple fields?
>
> Not exactly sure what you meant here.  The description field is just from
> CSV file for bank transaction downloads.  I thought I would have a table
> that just exactly maps the CSV files into it (then uniqueness is based on
> Date-Amount-Description)

My thought was that this "description" field looks like more than one
field glued together, probably screen-scraped from a bank terminal
interface somewhere. The multiple spaces imply that it's probably
fixed-width, so why not break the field apart according to those fixed-
width fields?
(Without any knowledge of the data source, it looks like [Name, City,
(Country?), (Account number?)])

--Matt Jones
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to