<budget_name>!REMOVE_SHARED_RESOURCE¶
Removes a shared resource from a custom budget. Shared resources are added to the budget using the ADD_SHARED_RESOURCE method.
Syntax¶
<budget_name>!REMOVE_SHARED_RESOURCE( '<domain>' [ , '<ai_function>' ] )
Arguments¶
'domain'The type of resource being removed from the budget. Valid values:
AI FUNCTION
Unless you specify a second argument, the budget stops tracking consumption for all AI functions.
'ai_function'Optional. When the
domainisAI FUNCTION, specifies a specific AI function to remove from the budget.
Returns¶
Returns a VARCHAR value that indicates whether or not the resource was successfully removed from the budget.
If the resource could not be removed from the budget, the function returns an error message.
Access control requirements¶
The following minimum privileges and roles are required to call this method on a custom budget:
ADMIN instance role for the budget instance.
USAGE privilege on the database and schema that contains the budget instance.
USAGE privilege on the database and schema that contain the resource (for schema objects).
For more information, see Budgets roles and privileges.
Usage notes¶
This method can only be called on custom budget instances.
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.
Examples¶
Remove all AI Functions from the budget:
CALL budget_db.budget_schema.my_budget!REMOVE_SHARED_RESOURCE('AI FUNCTION');
Remove the AI_COMPLETE function from the budget:
CALL budget_db.budget_schema.my_budget!REMOVE_SHARED_RESOURCE(
'AI FUNCTION',
(SELECT SYSTEM$REFERENCE('FUNCTION', 'AI_COMPLETE')));