This is probably obvious to someone who is familiar with Oracle, however, I'm writing a script file for a class, and it throws an error on the line

ALTER TABLE FACULTY
ADD CONSTRAINT FACULTY_Locid_fk REFERENCES LOCATION;

where the table is FACULTY, the column is Locid, and I'm trying to create a foreign key that references the LOCATION table.
It gives me an Invalid Datatype.

In the same token the line

ALTER TABLE STUDENT
ADD CONSTRAINT STUDENT_Sstate DEFAULT 'WI';

gives me an invalid identifier error.

Any input on proper syntax would be helpful, and yes, I did Google it. :)

1. referring and referenced table columns should be matching.

2. DEFAULT is not a constraint.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.