Hi all,
I have to set the primary key myself and not use sequences in an
Oracle schema
In http://thread.gmane.org/gmane.comp.lang.ruby.rails/118516 someone
writes,
“Correct, that’s the expected/correct behavior – so long as you
define
the PK properly, and set it yourself, it won’t try to use a sequence.”
I have
CREATE TABLE d_simulationproducts (
id NUMBER(38,0) NOT NULL,
simulationproducttype VARCHAR2(50) DEFAULT NULL NULL,
position NUMBER(38,0) DEFAULT NULL NULL,
productcategory VARCHAR2(50) DEFAULT NULL NULL,
simulationproductname VARCHAR2(255) NULL,
)
ALTER TABLE d_simulationproducts
ADD PRIMARY KEY (
id
)
SimulationProduct.columns
=> [#<ActiveRecord::ConnectionAdapters::OracleColumn:0x52bf750
@primary=true, @scale=0, @name=“id”, @null=false, etc…>
and do not override the id accessor in my model, nor manipulatig
set_sequence_name
When I try following in the console
SimulationProduct.create(:id=>1000)
it raises me the error : OCIError: ORA-02289: sequence does not exist
What am I doing wrong ?
Any hint is really appreciated,
Michael