<budget_ name>!REMOVE_ RESOURCE¶
Remove an object from a custom budget. The object must be removed by reference.
语法
实参
'object_reference'The serialized string representation that resolves to an object. This string is the output of the SYSTEM$REFERENCE function.
reference_statementA SYSTEM$REFERENCE statement that creates a reference for the object to be removed from the budget.
Note
If you want to add a Snowflake Native App to a budget, when you call SYSTEM$REFERENCE, specify 'DATABASE' (not 'APPLICATION')
for the object_type argument.
返回
返回 VARCHAR 值,用于指明对象是否已成功从预算中移除。例如:
If the object could not be removed from the budget, the function returns an error message. See You can’t add or remove objects from a custom budget.
访问控制要求
要对 自定义预算 调用此方法,需要具备以下最低权限和角色:
- ADMIN instance role for the budget instance.
- 对包含预算实例的数据库和架构的 USAGE 权限。
- 对包含该对象的数据库和架构的 USAGE 权限(对于架构对象)。
- 被移除对象的 APPLYBUDGET 权限。
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.
示例
以下示例展示了如何从自定义预算中移除对象:
从预算中移除表
-
The following example creates and returns a reference for the
t1table:
该语句会在输出中返回引用。
The following statement uses the string literal for this reference to remove the t1 table from the
budget_db.budget_schema.my_budget budget:
- The following example removes the
t2table from thebudget_db.budget_schema.my_budgetbudget, using a SQL statement to specify the reference:
Removing a Snowflake Native App from a budget¶
The following example removes the my_app application from the budget_db.budget_schema.my_budget budget.
Note that when calling SYSTEM$REFERENCE, you must pass in 'DATABASE' (not 'APPLICATION')
for the object_type argument.
错误消息
For a list of common error messages and their causes and solutions, see You can’t add or remove objects from a custom budget.