Recently I've encountered a problem, when I try to set user ROLEs by encapsulating the 'set role' code in a stored procedure, I received an error message:
Error::: ORA-06565: cannot execute SET ROLE from within stored procedure.
I've tried some solutions given on the Internet:
1. dbms_session.set_role('rolenames') - the same error
2. dbms_utility.exec_ddl_statement('SET ROLE rolename');
3. encapsulation in an anonymus block:
dbms_session.set_role('rolenames') - the same error
All of the above haven't solved my problem.
Can any of You help me, mayby by providing sample code, or navigate me to some document. Mayby what I'm trying to do is impossible, however this is certainly not an option in my situation. Thank you in advance.