title: How do I properly use CONSTRAINTS_AS_ALTER for GET_DDL?
body: <pre><code>exec dbms_metadata.set_transform_param(DBMS_METADATA.SESSION_TRANSFORM, 'CONSTRAINTS_AS_ALTER', TRUE);
  
  SELECT DBMS_METADATA.GET_DDL(object_type, object_name, owner) FROM all_OBJECTS WHERE  
  OWNER = 'USERNAME' AND OBJECT_TYPE = 'TABLE';
  </code></pre>
  
  <p>When I run these commands, unfortunately I am getting the alter statements after each table. I would prefer to have the DDL generated for all of my tables, then have that followed by the alter statements to set up the constraints. Currently, the alter statement runs and fails for some tables because the table being referenced has not been created yet.</p>
  
  <p>I have seen this command:</p>
  
  <pre><code>select dbms_metadata.get_ddl('CONSTRAINT',constraint_name) from user_constraints; 
  </code></pre>
  
  <p>But to use that wouldn't I have to somehow tell <code>GET_DDL</code> to not generate any constraints at all?</p>
  
  <p>Is there some way to just make the tables created in the right order?</p>
  
  <p>Thanks!</p>