Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

select dbms_metadata.get_dependent_ddl fails with ORA-31604 yet type exists for the object

1007321Nov 19 2013 — edited Nov 20 2013

Hi,

In DBA DEPENDENCIES I can see I have objects (views here) depending on a certain table:

-- SQL> select type, owner, name

--   2  from dba_dependencies where REFERENCED_OWNER = upper('stuff')

--   3  and REFERENCED_name = upper('st_tab')  and type='VIEW';

-- TYPE  OWNER NAME

-- ----- ----- ------------------

-- VIEW  STUFF STTAB_4MV_VW

-- VIEW  STUFF STTAB_VW

But when trying to retrieve these 2 views definitions  I get an error:

-- SQL> select dbms_metadata.get_dependent_ddl('VIEW','ST_TAB','STUFF') def from dual;

-- ERROR:

-- ORA-31604: invalid NAME parameter "BASE_OBJECT_NAME" for object type VIEW in function SET_FILTER

-- ORA-06512: at "SYS.DBMS_SYS_ERROR", line 116

-- ORA-06512: at "SYS.DBMS_METADATA_INT", line 4705

-- ORA-06512: at "SYS.DBMS_METADATA_INT", line 8582

-- ORA-06512: at "SYS.DBMS_METADATA", line 2882

For certain objects it  works (triggers, indexes) but for other (views, procedures, pkgs...) it always fails with ORA 31604.

If I do a direct call on dbms_metadata.get_ddl('VIEW', 'STTAB_4MV_VW', 'STUFF') it works fine.

Anybody ever saw this behaviour before ? (tried this code on 10g and 11g)

Thanks a lot.

Regards,

Seb

This post has been answered by unknown-7404 on Nov 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2013
Added on Nov 19 2013
2 comments
1,443 views