<budget_name>!REMOVE_CUSTOM_ACTIONS

Remove one or more custom actions from a budget.

See also:

<budget_name>!ADD_CUSTOM_ACTION, <budget_name>!GET_CUSTOM_ACTIONS

语法

<budget_name>!REMOVE_CUSTOM_ACTIONS()

<budget_name>!REMOVE_CUSTOM_ACTIONS( <threshold> )

<budget_name>!REMOVE_CUSTOM_ACTIONS( <threshold>, '<stored_procedure>' )

实参

threshold

触发自定义操作的阈值百分比。如果未指定过程名称,则移除为此阈值设置的所有自定义操作。

'stored_procedure'

与自定义操作关联的存储过程的完全限定名称。Snowflake 会移除与指定存储过程和阈值匹配的所有自定义操作。

Note

When passing the fully qualified name of the procedure, use the PROCEDURE_FQN value from the output of the GET_CUSTOM_ACTIONS method.

返回

返回一个 VARCHAR 值,表示已成功移除的自定义操作的数量。

访问控制要求

要为预算调用此方法,需要具备以下权限和角色:

  • ADMIN instance role for the budget instance.
  • 对包含预算实例的数据库和架构的 USAGE 权限。

For more information, see Budgets roles and privileges.

使用说明

Calling this method does not return the object. Because of this, you can’t use method chaining to call another method on the return value of this method. Instead, call each method in a separate SQL statement.

示例

Remove all custom actions from budget my_budget in schema budget_db.sch1:

CALL budget_db.sch1.my_budget!REMOVE_CUSTOM_ACTIONS();

移除当使用量达到预算限制的 75% 时触发的所有自定义操作:

CALL budget_db.sch1.my_budget!REMOVE_CUSTOM_ACTIONS(75);

Remove the custom action that calls the code_db.sch1.my_sp stored procedure when consumption reaches 75% of the budget limit:

CALL budget_db.sch1.my_budget!REMOVE_CUSTOM_ACTIONS(75, 'code_db.sch1.my_sp');