Can GRANT be used inside an Oracle Store Procedure?

后端 未结 2 883
梦毁少年i
梦毁少年i 2020-12-21 05:24

When trying to place a GRANT statement in an Oracle 11 stored procedure, it reports that GRANT is an unexpected symbol. Does GRANT need to be prefaced by something, or does

2条回答
  •  渐次进展
    2020-12-21 06:05

    It's a bad idea to use DDL (like GRANT) inside stored procedures.

    You will have to use dynamic SQL (EXECUTE IMMEDIATE) to do this, but, honestly, I don't see why would you want to do this inside a stored proc.

提交回复
热议问题