Hi,

My setup is:

Ruby 1.8.6
Rails 2.3.5
activerecord-oracle-adapter (1.0.0.9250)

I upgraded Rails and the adapter recently and I just went through hell
trying to find a problem while inserting a record in a table.

Rails was giving me this error:

OCIError (ORA-02289: sequence does not exist):
  stmt.c:539:in oci8lib.so
  c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:753:in `exec'
  c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:142:in `do_ocicall'
  c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:753:in `exec'
  c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:255:in `exec'
  c:/ruby/lib/ruby/gems/1.8/gems/activerecord-oracle-
adapter-1.0.0.9250/lib/active_record/connection_adapters/
oracle_adapter.rb:700:in `exec'
  c:/ruby/lib/ruby/gems/1.8/gems/activerecord-oracle-
adapter-1.0.0.9250/lib/active_record/connection_adapters/
oracle_adapter.rb:229:in `next_sequence_value'
  app/controllers/datafile_controller.rb:248:in `approval'

However what the real problem was is this:

ORA-01861 Literal Does Not Match Format String

As it turns out (and after lots of research and unless I am crazy
already) the problem seems to be in the INSERT statement that is
generated. Here goes an example (edited with just some date and
datetime values):

INSERT INTO (...) VALUES('2011-01-01', '2009-12-30 00:18:54',
'2010-06-30 00:00:00', '1995-01-01', '2009-12-30 00:18:54')

If I try to run manually the INSERT statement generated by Rails I get
the ORA-01861 error but if I run it editing the dates or datetime
values in format 'DD-MON-YY' (e.g.: '01-JAN-11'), as a post I found
suggested, the record is written to the table. BTW, in case it helps
all fields in the table that would receive a date or datetime value
are of type DATE.

Did I miss something obvious and it's just me not knowing how to set
the date/datetime values or is this a known problem?

Thank you.

--

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