Skip to Main Content

SQL & PL/SQL

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!

What changed from 11gR2 to 12c that would cause PLS-00452?

duretteJan 20 2015 — edited Jan 21 2015

I'm working on staging a migration. The following code block works in our Oracle Database Standard Edition 11.2.0.3 environment on Windows but fails in our 12.1.0.1.0 environment on Linux. It works in both environments if I remove the PRAGMA. Did something change, or am I missing a migrated configuration setting in my control file?

CREATE OR REPLACE PACKAGE test_package IS

  FUNCTION get_view_exist (view_name_ IN VARCHAR2) RETURN NUMBER;

  PRAGMA restrict_references(get_view_exist, WNDS);

END test_package;

/

CREATE OR REPLACE PACKAGE BODY test_package IS

  FUNCTION get_view_exist (view_name_ IN VARCHAR2) RETURN NUMBER

  IS

     dummy_          NUMBER := 0;

     CURSOR check_view IS

        SELECT  1

        FROM    user_views

        WHERE   view_name = UPPER(view_name_);

  BEGIN

     OPEN  check_view;

     FETCH check_view INTO dummy_;

     IF (check_view%FOUND) THEN

        CLOSE check_view;

        RETURN 1;

     ELSE

        CLOSE check_view;

        RETURN 0;

     END IF;

  END get_view_exist;

END test_package;

/

SELECT test_package.get_view_exist('MY_VIEW') FROM DUAL;

Thanks in advance.

Kevin L. Durette

*** personal web link removed by moderator - please only include personal links in your profile - not in posts ***

Message was edited by: BluShadow

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 17 2015
Added on Jan 20 2015
3 comments
1,738 views