Saskia
2012-11-05 13:57:37 UTC
I am trying to remove a foreign key constraint from one of my tables in SQL Plus, and I keep getting errors. I have seen online that the syntax for dropping a foreign key constraint from a table is
ALTER TABLE table_name drop CONSTRAINT constraint_name;
But how do I know the "name" of the constraint? Specifically, I have a table created with the following command:
create table depositor
(customer_name varchar(15) not null,
account_number varchar(15) not null,
primary key(customer_name, account_number),
foreign key(account_number) references account(account_number));
I have tried to remove the constraint this way:
alter table depositor
drop foreign key account_number;
and it says, "error, missing keyword." Is "account_number" not the correct name for this constraint? Or am I doing something else wrong?
Thanks!
Thanks.