A piece of legacy code I’m running that does some oracle SQL is violating a constraint called REF_REQUEST.
I look up this constraint by doing:
select * from all_constraints where constraint_name='REF_REQUEST'
This tells me that the constraint_type is ‘R’, and it gives me the table name of CORRESPONDENCE.
However, I still don’t know… what value I’m missing from CORRESPONDENCE, or where I’m trying to insert that is causing the issue, and what column is relevant from each. How can I learn this information by querying the dB?
Use
get_ddlmethod indbms_metadatapackage to get more details about the constraintThat should tell you what columns the constraint is acting on
One of the overloaded methods accepts the schema name, so you can pass it as a parameter.
Further reading: