Make use of DBMS_METADATA.get_ddl instead of custom logic for structure_dump_db_stored_code