Create Or Replace Procedure Batch_check_ddl_p (in_username In Varchar2 ) Is /* **************************************** * *********************** Name: batch_insert_tablea_p * purpose: -- batch query the table creation statement * imput: -- table name sub-* output: -- N/A * Author: -- Cici * createdate: -- 2012, 12, 24 * updatedate: --*************************************** ******************** */ V_table_names Varchar2 ( 10000 ); Cursor Cur Is Select Object_name From All_objects Where Owner = Upper (In_username) And Object_type = ' Table ' ; Begin /* Query the information of all tables belonging to the ss_hr user */ Open Cur; Fetch Cur Into V_table_names; While Cur % Found Loop Exit When Not Cur % Found; -- Ends if the cursor ends at the end. /* Retrieve table creation statements through Traversal */ Dbms_output.put_line ( ' ========================================================== ========== ' ); Dbms_output.put_line (dbms_metadata.get_ddl (object_type => ' Table ' , Name => Upper (V_table_names ), Schema => Upper (In_username); dbms_output.put_line ( ' ========================================================== ========== ' ); Fetch Cur Into V_table_names; End Loop; Close Cur; End Batch_check_ddl_p;