APEX-AT-WORK no image

Generate DDL Source Code with SQL

Von Tobias Arnhold 3.27.2013
I just found this little piece of code to create DDL source code.
SELECT dbms_metadata.get_ddl(replace(OBJECT_TYPE, ' ', '_'), OBJECT_NAME,OWNER) as DDL_SOURCE_CODE
FROM ALL_OBJECTS
WHERE OBJECT_TYPE IN 
   ('SEQUENCE',   'TABLE',           'INDEX',
    'VIEW',       'DATABASE LINK',   'MATERIALIZED VIEW',
    'FUNCTION',   'PROCEDURE',       'PACKAGE',
    'PACKAGE BODY'
    )
AND OWNER = '#SCHMEA_NAME#';

Post Tags:

1 One Comment " Generate DDL Source Code with SQL "

Anonymous

Hallo
Mit bms_metadata.set_transform_param - siehe Oracle PL/SQL Packages and Types Reference - sind dann noch ein paar weitere Optionen drin

MfG Peter van Garsel