views:

28

answers:

1

Why is dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'CONSTRAINTS_AS_ALTER', TRUE) not generating constraints in separate files? At this moment this pl/sql pastes the constraints after the table schema definition files. What flag do I have to use to achieve this separate constraints schema definition directory?

+1  A: 

DBMS_METADATA.GET_DDL returns a single CLOB, not a file and definitely not multiple files.

The only way to get separate CLOBs for each constraint is to do a separate GET_DDL for each constraint:

select dbms_metadata.get_ddl('CONSTRAINT',constraint_name) 
from user_constraints;
Gary
But the USER_OBJECTS table has these types FUNCTION INDEX, PACKAGE, PACKAGE BODY, PROCEDURE, SEQUENCE, TABLE, TRIGGER, VIEW Is there a way to get all constraints from Oracle? Which Oracle view should I use?
blaap