Execute Immediate fails even with CREATE table grant

后端 未结 4 648
一向
一向 2020-12-11 19:33

I have a problem where I am creating a table using the execute immediate command in the stored procedure. However I get the error of \"insufficient privileges\". I checked o

4条回答
  •  鱼传尺愫
    2020-12-11 19:59

    When using execute immediate, procedure must explicitly tell oracle that it must run with privileges of a particular user.

    AUTHID CURRENT_USER, to use the privileges of user running the procedure. AUTHID DEFINER, to use the privileges of owner of the procedure.

    This is done using AUTHID option while creating a procedure.

    CREATE OR REPLACE PROCEDURE PROC_NAME AUTHID CURRENT_USER
    IS
    .....
    

    I faced a similar issue and got the understanding from: Execute Immediate within a stored procedure keeps giving insufficient priviliges error

提交回复
热议问题