constraints - drop foreign key without name Oracle -


I want to ask a very basic question here. After creating the table or creating a table, we can not name a barrier. Let's say I did not choose the name of the foreign key obstacle.

There are no records in the table.

Can I delete the foreign key name without it's name?

I know how to get the name of the foreign key and then delete it using it

  table my_table drop barrier fk_name;  

But I want to delete / leave the foreign key barrier without mentioning its name.

Is there any way to do this?

<

But I delete the foreign key barrier without mentioning its name / Want to leave

This is not possible. A foreign key hurdle required is a name though you can find out the System Generated Name:

 Select constraint_name from user_constraints where the table_name = 'MY_TABLE' and constraintype = 'R';  

will show you all the foreign keys defined on table MY_TABLE . Using that statement, you can also generate the necessary DDL statement:

  Select 'Change table'. Table_name || ' 'Drop Barrier' 'constraint_name ||' '' User_constraints where table_name = 'MY_TABLE' and constraintype = 'R';  

Save the output of that file to a file and you have There are statements (s) to drop all the foreign keys from that table.


Comments