Forum Stats

  • 3,780,468 Users
  • 2,254,399 Discussions
  • 7,879,341 Comments

Discussions

Question when extracting procedure using DBMS_METADATA.GET_DDL.

Question when extracting procedure using Oracle 12c Version DBMS_METADATA.GET_DDL.

Oracle Database 12c Enterprise Edition Version 12.2.0.1.0


1. If you use double quotation when you create procedure.

CREATE PROCEDURE "TEST"."RESULT1"

BEGIN

  NULL;

END


2. If you don't use double quotes when you create procedure.

CREATE PROCEDURE TEST.RESULT2

BEGIN

  NULL;

END


Extract using "DBMS_METADATA.GET_DDL" in each case.

1. SELECT DBMS_METADATA.GET_DDL('PROCEDURE','RESULT1','TEST') FROM DUAL;

--RESULT

CREATE OR REPLACE NONEDITIONABLE PROCEDURE "TEST"."RESULT1"

BEGIN

 NULL;

END


2. SELECT DBMS_METADATA.GET_DDL('PROCEDURE','RESULT2','TEST') FROM DUAL;

--RESULT

CREATE OR REPLACE NONEDITIONABLE PROCEDURE "TEST"."RESULT2" RESULT2

BEGIN

 NULL;

END


  • In the second case, Please help prevent object_name from being printed twice.


Answers