Skip to content

Instantly share code, notes, and snippets.

@luizvaz
Created December 19, 2020 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizvaz/068d953cac8bea10e0bc6d5b89790e7d to your computer and use it in GitHub Desktop.
Save luizvaz/068d953cac8bea10e0bc6d5b89790e7d to your computer and use it in GitHub Desktop.
Oracle Table DDL
SET LONG 20000 LONGCHUNKSIZE 20000 PAGESIZE 0 LINESIZE 1000 FEEDBACK OFF VERIFY OFF TRIMSPOOL ON
BEGIN
DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, 'SQLTERMINATOR', true);
DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, 'PRETTY', true);
-- Uncomment the following lines if you need them.
--DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, 'SEGMENT_ATTRIBUTES', false);
--DBMS_METADATA.set_transform_param (DBMS_METADATA.session_transform, 'STORAGE', false);
END;
/
SELECT DBMS_METADATA.get_ddl ('TABLE', table_name, owner)
FROM all_tables
WHERE owner = UPPER('OWNER')
AND table_name = UPPER('TABLE_NAME');
SET PAGESIZE 14 LINESIZE 100 FEEDBACK ON VERIFY ON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment