My Oracle Support Banner

Calling Dbms_metadata.Get_ddl From Stored Procedure Results In Ora-31603 (Doc ID 463483.1)

Last updated on MARCH 06, 2019

Applies to:

Oracle Database - Enterprise Edition - Version and later
Information in this document applies to any platform.


Calling dbms_metadata.get_ddl from a stored procedure to get the DDL of an object in another schema raises the following error:

ERROR at line 1:
ORA-31603: object <Object Name> of type <Object Type> not found in schema <Schema Name>
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 2805
ORA-06512: at "SYS.DBMS_METADATA", line 4333
ORA-06512: at line 1
ORA-06512: at <Stored Procedure Name>, line 16
ORA-06512: at line 1

Calling the dbms_metadata.get_ddl directly from sql*plus on the same object works fine.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.