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 -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -

php - Cannot override Laravel Spark authentication with own implementation -