Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid Identifier on Foreign Key - Why?

563529Apr 10 2007 — edited Apr 10 2007
Hello guys, please hel me if you can.

I keep getiing an invalid identifier on foreign key (fk_cust_id) on the last table cust_rental table. What am I doing wrong?
I have checked with the oracle error code and seem to be doing it right. What's wrong?

create table account
(accno number(7) not null,
charges number(10),
acct_change number(10),
constraint pk_account primary key (accno)
)
;
create table customer
(cust_id number(9) not null,
first_name varchar2(30),
last_name varchar2(30) not null,
phone_no char(10),
st_address varchar2(50),
zip_code char(5),
city varchar2(20),
state char(2),
contact varchar2(40),
constraint pk_customer primary key (cust_id)
)
;
create table cust_rental
(rentdate date not null,
returndate date,
constraint fk_customer foreign key (fk_cust_id) references customer
)
;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 8 2007
Added on Apr 10 2007
6 comments
3,038 views