EDITION_NAME Column of USER_OBJECTS Empty for an Editioned Object (Doc ID 1098184.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version: 11.2.0.1 and later   [Release: 11.2 and later ]
Oracle Server - Enterprise Edition - Version: 11.2.0.1.0 and later    [Release: 11.2 and later]
Information in this document applies to any platform.

Symptoms

The following script creates a new edition and makes this edition the current edition executing the command ALTER SESSION SET EDITION... .
Then a procedure is recreated returning a different output when calling the package DBMS_OUTPUT than the same procedure of the parent edition ORA$BASE.
Checking the USER_OBJECTS table for the procedure you will see that its column EDITION_NAME is empty.


connect sys/wotan as sysdba

set serverout on
drop edition e2 cascade;
drop user eduser cascade;
create user eduser identified by eduser;

grant connect,resource,dba to eduser identified by eduser;

connect eduser/eduser

CREATE OR REPLACE PROCEDURE hello IS
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, edition 1.');
END hello;
/

SELECT sys_context('USERENV', 'CURRENT_EDITION_NAME') FROM dual;
SELECT object_type, edition_name FROM user_objects where object_name = 'HELLO';

BEGIN hello(); END;
/

CREATE EDITION e2;

ALTER SESSION SET EDITION = e2;

BEGIN hello(); END;
/

CREATE OR REPLACE PROCEDURE hello IS
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, edition 2.');
END hello;
/

SELECT sys_context('USERENV', 'CURRENT_EDITION_NAME') FROM dual;

SELECT object_type, edition_name FROM user_objects where object_name = 'HELLO';

BEGIN hello(); END;
/

Output of the SELECT of USER_OBJECTS:

OBJECT_TYPE EDITION_NAME
------------------- ------------------------------
PROCEDURE

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms