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
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
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
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
Any and all help appreciated!