Hi all,
I''m trying to put together a quickie front-end for a maintenance task
that has to be done on a legacy Oracle database. In particular,
putting a date criteria in my conditions clause causes rails not to
return any rows, ever, even when the same where clause works fine
elsewhere.
Ever seen anything like this?
In rails (either script/console or from my controller call), no
records get returned.No error messages, it just doesn''t return
anything.
script/console
Loading development environment.
-- Followup.find(:all, :conditions => "group_id = 3 AND
trunc(time_stp) = ''07JAN2007''")
=> []
Development log looks fine. In fact, this sql works great in sqlplus.
Rails just isn''t getting anything back.
Followup Load (0.124121) SELECT * FROM followup WHERE (group_id 3 AND
trunc(time_stp) = ''07JAN2007'')
In IRB (and sql plus) things work like I''d expect:
irb(main):005:0> OCI8.new("myuser", "mypwd",
"myinstance").exec("
SELECT * FROM followup where group_id = 3 AND trunc(time_stp)
''07JAN2007''") do |r| puts r.join(","); end
503252,503251,3,5449,2007/01/07 02:04:06,,
503255,503254,3,8026,2007/01/07 02:06:06,,
503355,503354,3,214938,2007/01/07 19:05:16,,
503359,503357,3,503358,2007/01/07 19:06:56,,
503313,503311,3,503312,2007/01/07 15:07:50,,
503315,503161,3,503314,2007/01/07 15:08:35,,
=> 6
The problem, whatever it is, is related to the date part of the
comparison. If I take the date bits out, then rails makes the call
just fine.
Any and all help appreciated!
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---