Skip to Main Content

APEX

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!

Unable to compile procedure with SYS.DBA_OBJECTS

88KeysSep 17 2014 — edited Sep 17 2014

I want to include the following SQL in a procedure:

  SELECT COUNT(*)

   FROM SYS.DBA_OBJECTS

WHERE OBJECT_TYPE = 'DATABASE LINK'

When i run this SQL outside the procedure, the SQL is successful.  When I include the same SQL in a procedure, I get ORA-00942: table or view does not exist.  Inside the procedure, I have tried the FROM statement both with and without SYS. and have tried double quotes around "SYS" "DBA_OBJECTS" together and separately.  In all cases, the SQL runs outside the procedure but not within it.

Any ideas what I'd need to do to get this SQL to run in a procedure?

Thanks, Edward

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2014
Added on Sep 17 2014
2 comments
758 views