EXECUTE IMMEDIATE fails with insufficient privilege [message #369960] |
Mon, 20 November 2000 16:47 |
Chetan
Messages: 21 Registered: November 2000
|
Junior Member |
|
|
I can EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE TEMP_TAB(TNAME VARCHAR2(30))' from SQL*Plus. But when the same code is executed from within the Stored Procedure, it fails with ORA-01031: insufficient privileges.
|
|
|
|
|
|
Re: EXECUTE IMMEDIATE fails with insufficient privilege [message #369976 is a reply to message #369960] |
Tue, 21 November 2000 15:00 |
Chetan
Messages: 21 Registered: November 2000
|
Junior Member |
|
|
I found that all roles are disabled in any named PL/SQL block that executes with definer rights. Named PL/SQL blocks that execute with invoker rights are executed based on privileges granted through enabled roles. Hence, I executed the stored procedure with invoker rights and current roles were used for privilege checking within an invoker rights PL/SQL block. I was thus able to EXECUTE IMMEDIATE from the stored procedure. Thank You guys for your response.
|
|
|
|
|