Quote (carteblanche @ Mar 27 2016 01:48am)
post your CREATE TABLE job_history script. the one you already posted doesn't include it.
Code
CREATE TABLE job_history
(employee_id NUMBER(3),
start_date DATE,
end_date DATE,
job_id NUMBER(3),
department_id NUMBER(3),
PRIMARY KEY (employee_id, start_date),
FOREIGN KEY (employee_id, start_date) REFERENCES employees(employee_id,hire_date),
--FOREIGN KEY (employee_id) REFERENCES employees(employee_id),
--FOREIGN KEY (start_date) REFERENCES employees(hire_date),
FOREIGN KEY (job_id) REFERENCES jobs(job_id),
FOREIGN KEY (department_id) REFERENCES departments(department_id));
edit
SQL Error: ORA-02270: no matching unique or primary key for this column-list
02270. 00000 - "no matching unique or primary key for this column-list"
*Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement
gives a column-list for which there is no matching unique or primary
key constraint in the referenced table.
*Action: Find the correct column names using the ALL_CONS_COLUMNS
catalog view
//edit
Narrowed it down to this. Is this not legal?
Code
FOREIGN KEY (start_date) REFERENCES employees(hire_date),
This post was edited by ROM on Mar 27 2016 12:24am