Oracle SQL

This category will hold examples for Oracle SQL.

Recently I had to drop some foreign key constraints on tables.

Below the SQL, which did the job for me. After 'drop constraint' you have to provide the name of a constraint you want to delete as it is maintained in table all_constraints.

Alter Table
a_table
drop constraint
fk_any_table_ref;

If you have to know the current database version, you can get this information using the following SQL.

SQL

1
SELECT * FROM V$VERSION;