oracle ddl

Solutions on MaxInterview for oracle ddl by the best coders in the world

showing results for - "oracle ddl"
Rahma
01 Jan 2020
1-- 4000 characters max
2SELECT dbms_metadata.get_ddl('PROCOBJ', 'job_name', 'owner') FROM DUAL;
3SELECT dbms_metadata.get_ddl('PROCOBJ', 'program_name', 'owner') FROM DUAL;
4SELECT dbms_metadata.get_ddl('TABLE', 'table_name', 'owner') FROM DUAL;
5SELECT dbms_metadata.get_ddl('VIEW', 'view_name', 'owner') FROM DUAL;
6
7SELECT dbms_metadata.get_ddl('PACKAGE', 'pkg_name', 'owner') FROM DUAL; 
8SELECT dbms_metadata.get_ddl('PROCEDURE', 'proc_name', 'owner') FROM DUAL; 
9
10SELECT dbms_metadata.get_ddl('INDEX', 'index_name', 'owner') FROM DUAL;
11SELECT dbms_metadata.get_ddl('TYPE', 'type_name', 'owner') FROM DUAL;
Camila
21 Jan 2020
1-- Views (use USER_VIEWS or DBA_VIEWS if needed):
2SELECT TEXT FROM ALL_VIEWS WHERE upper(VIEW_NAME) LIKE upper('%VIEW_NAME%');
3-- Or:
4SELECT dbms_metadata.get_ddl('VIEW', 'VIEW_NAME', 'OWNER_NAME') FROM DUAL;
5
6-- Materialized views (use USER_VIEWS or DBA_VIEWS if needed):
7SELECT QUERY FROM ALL_MVIEWS WHERE upper(MVIEW_NAME) LIKE upper('%VIEW_NAME%');
8-- Or:
9SELECT dbms_metadata.get_ddl('MATERIALIZED_VIEW', 'VIEW_NAME', 'OWNER_NAME') 
10FROM DUAL;