oracle - ORA-02253: constraint specification not allowed here -


create table log_table( log_id varchar2(1000) primary key, voter_id varchar2(1000), date_logged date constraint abc foreign key (voter_id) references voters(voter_id) ) 

the table works when create without date element. when add date element says:

ora-02253: constraint specification not allowed here

the table works when create without date element

create table log_table( log_id varchar2(1000) primary key, voter_id varchar2(1000),   -- comma constraint abc foreign key (voter_id) references voters(voter_id) ) 

you have add , before constraint:

create table log_table( log_id varchar2(1000) primary key, voter_id varchar2(1000), date_logged date, -- here constraint abc foreign key (voter_id) references voters(voter_id) ) 

i reconsider datatype of log_id/voter_id (number/integer).


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -