<budget_name>!REFRESH_USAGE

Causes the budget to retrieve consumption data so that the budget can compare it to the spending limit without waiting for the next automatic retrieval of data.

Syntax

<budget_name>!REFRESH_USAGE()
Copy

Returns

Returns a VARCHAR value that indicates whether the usage was successfully refreshed.

Access control requirements

The following minimum privileges and roles are required to call this method for custom budgets:

  • ADMIN instance role for the budget instance.

  • USAGE privilege on the database and schema that contains the budget instance.

For more information, see Budgets roles and privileges.

Usage notes

  • This method can only be called on custom budget instances.

  • It takes a few minutes for the budget to be refreshed with new usage data.

  • 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.

Example

Retrieve consumption data for the budget_db.budget_schema.my_budget budget:

CALL budget_db.budget_schema.my_budget!REFRESH_USAGE();
Copy
Language: English