创建函数时 or replace的作用

本文介绍了Oracle数据库中OR REPLACE的作用。使用此关键字可以重新创建已存在的函数,而不需要删除和重新授予先前的权限。这使得函数重定义后,原有用户的权限仍然有效。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

    今天在看Oracle官方文档时,发现了or replace的一个重要作用。 之前在该函数上赋予的权限使用or replace时,可以不同再次赋予。  即:使用or replace时,其它用户在该函数上的权限不会丢失和变化。

 

Specify OR REPLACE to re-create the function if it already exists. Use this clause to change the definition of an existing function without dropping, re-creating, and regranting object privileges previously granted on the function. If you redefine a function, then Oracle Database recompiles it.

Users who had previously been granted privileges on a redefined function can still access the function without being regranted the privileges.

If any function-based indexes depend on the function, then Oracle Database marks the indexes DISABLED.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值