Remove Foreign Keys from Database - Intergraph Smart Instrumentation - 13.1 - Installation & Upgrade - Intergraph

Intergraph Smart Instrumentation Installation and Upgrade

Language
English
Product
Intergraph Smart Instrumentation
Search by Category
Installation & Upgrade
Smart Instrumentation Version
13.1

Oracle

If you are using an Oracle database you must run the following SQL query to create a list of foreign keys that have to be removed from the database. If after running the SQL query foreign keys are found, contact Hexagon PPM Smart Community.

SELECT a.table_name child_table,

b.table_name parent_table,

a.constraint_name child_constraint,

b.constraint_name parent_constraint,

c.column_name child_column,

d.column_name parent_column

FROM user_constraints a,

user_constraints b,

user_cons_columns c,

user_cons_columns d

WHERE a.constraint_type = 'R'

AND b.constraint_type = 'P'

AND b.constraint_name = a.r_constraint_name

AND A.table_name = c.table_name

AND b.table_name = d.table_name

AND a.constraint_name = c.constraint_name

AND b.constraint_name = d.constraint_name

AND c.position = d.position

order by a.table_name, b.table_name , a.constraint_name, b.constraint_name;