I''m trying to connect to an existing oracle database. Some tables in this database do not have a standard "id" field, or any other primary keys. As I understand it, I can specify which table a model refers to: class MyModel < ActiveRecord::Base set_table_name "t_mymodel" end However using this method, I cannot perform a save command on my model. Attemnpting it yields this error: ORA-02289: sequence does not exist I thought by setting the sequence name to an empty string would solve it: class MyModel < ActiveRecord::Base set_table_name "t_mymodel" set_sequence_name "" end But that yields: ORA-00936: missing expression Any assistance would be most appreciative --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You might have luck with this: http://wiki.rubyonrails.org/rails/pages/HowToUseLegacySchemas I''m doing some Rails work with some legacy Oracle tables but right now I''ve only been reading data and not writing... Good luck! Reacher wrote:> I''m trying to connect to an existing oracle database. Some tables in > this database do not have a standard "id" field, or any other primary > keys. As I understand it, I can specify which table a model refers > to: > > class MyModel < ActiveRecord::Base > set_table_name "t_mymodel" > end > > However using this method, I cannot perform a save command on my > model. Attemnpting it yields this error: > > ORA-02289: sequence does not exist > > I thought by setting the sequence name to an empty string would solve > it: > > class MyModel < ActiveRecord::Base > set_table_name "t_mymodel" > set_sequence_name "" > end > > But that yields: > > ORA-00936: missing expression > > Any assistance would be most appreciative-- 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 -~----------~----~----~----~------~----~------~--~---