Hi,
This is not due to the Oracle Adapter.
You need to write the SQL like this:
> SELECT *
> FROM people
> WHERE created_at = to_date(''2008-04-15 12:00:00'',
''YYYY-MM-dd HH-MI-SS'')
--
Cheers,
Jesse
2008/4/14, Alex Moore
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:>
>
> I''m trying to find all people that we''re created at a
specific date and
> time, however rails does not seem to be performing the correct
> conversion into oracle''s format. Should this work by default? I
can
> fix it by wrapping in a date function, but I thought this was something
> that should be handled by the adapater.
>
> Person.find_all_by_created_at(DateTime.parse(params[:created_at]))
>
> #The query it generates
> SELECT *
> FROM people
> WHERE created_at = ''2008-04-15 12:00:00''
>
> #The Oracle Error
> SQL Error: ORA-01861: literal does not match format string
> 01861. 00000 - "literal does not match format string"
> *Cause: Literals in the input must be the same length as literals in
> the format string (with the exception of leading whitespace).
> If the
> "FX" modifier has been toggled on, the literal must
match
> exactly,
> with no extra whitespace.
> *Action: Correct the format string to match the litera
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---