Inconsistent REP-1247 Error When Roles Enabled From Oracle Reports Trigger

(Doc ID 1315139.1)

Last updated on AUGUST 02, 2016

Applies to:

Oracle Reports Developer - Version 10.1.2.3 and later
Information in this document applies to any platform.
"Checked for relevance on 22-May-2013"

Symptoms

You have a database role that must be enabled before running a report from Oracle Reports. You create the code to enable the role in the Before Parameter Form trigger of the report. The code may look like:

DBMS_SESSION.SET_ROLE('myrole identified by "password"');
or
SRW.DO_SQL('set role myrole identified by "password"');

You run the report successfully most of the time, but sometimes it fails with error:

REP-1247: Report contains uncompiled PL/SQL.
or
REP-771: Report contains uncompiled PL/SQL.

You try putting the SET ROLE code in all the triggers (Before Parameter Form, After Parameter Form, Before Report, etc.), but the inconsistency still occurs.

Why does the role get enabled sometimes but not always?

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