A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/developer-guide/python-connector/../../sql-reference/sql/create-alert below:

Website Navigation


CREATE ALERT | Snowflake Documentation

CREATE ALERT

Creates a new alert in the current schema.

This command also supports the following variant:

Tip

In addition to SQL, you can also use other interfaces, such as Snowflake REST APIs, Snowflake Python APIs, and Snowflake CLI. See Alternate interfaces.

See also:

ALTER ALERT , DESCRIBE ALERT, DROP ALERT , SHOW ALERTS , EXECUTE ALERT

Syntax
CREATE [ OR REPLACE ] ALERT [ IF NOT EXISTS ] <name>
  [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] ) ]
  [ SCHEDULE = '{ <num> MINUTE | USING CRON <expr> <time_zone> }' ]
  [ WAREHOUSE = <warehouse_name> ]
  [ COMMENT = '<string_literal>' ]
  IF( EXISTS(
    <condition>
  ))
  THEN
    <action>

Copy

Variant syntax

CREATE ALERT … CLONE

Creates a new alert with the same parameter values:

CREATE [ OR REPLACE ] ALERT <name> CLONE <source_alert>
  [ ... ]

Copy

For more details, see CREATE <object> … CLONE.

Note

When you clone an alert by using CREATE ALERT <name> CLONE or by cloning a schema or database containing the alert, the new alert has all of the properties of the original alert except for any properties that you explicitly override.

Required parameters
name

String that specifies the identifier (i.e. name) for the alert; must be unique for the schema in which the alert is created.

In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more details, see Identifier requirements.

TAG ( tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ] )

Specifies the tag name and the tag string value.

The tag value is always a string, and the maximum number of characters for the tag value is 256.

For information about specifying tags in a statement, see Tag quota for objects.

IF( EXISTS( condition ))

The SQL statement that represents the condition for the alert. You can use the following commands:

If the statement returns one or more rows, the action for the alert is executed.

THEN action

The SQL statement that should be executed if the condition returns one or more rows.

To send a notification, you can call the SYSTEM$SEND_EMAIL or SYSTEM$SEND_SNOWFLAKE_NOTIFICATION stored procedure.

Optional parameters
WAREHOUSE = warehouse_name

Specifies the virtual warehouse that provides compute resources for executing this alert.

SCHEDULE ...

Specifies the schedule for periodically evaluating the condition for the alert on a schedule.

When you create an alert, omitting this parameter or setting it to NULL creates an alert on new data.

For alerts on a schedule, you can specify the schedule in one of the following ways:

COMMENT = 'string_literal'

Specifies a comment for the alert.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes Examples

See Creating an alert.

Alternate interfaces

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4