Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

CREATE_LABEL

Stored procedure CREATE_LABEL is a Snowflake stored procedure written in Python that is used to construct a label object. This procedure is defined in database SUNDECK (database where Snowflake NativeApp is installed) schema ADMIN.

ACCOUNTADMIN privilege is required to run this stored procedure.

See also:
UPDATE_LABEL, DELETE_LABEL, SHOW PROCEDURES, DESCRIBE PROCEDURE

Syntax

CREATE_LABEL(<name>,
             <group>, 
             <rank-number>,
             <condition>)

Arguments

<name>
a string that represents label name. Label name can not have the same name as a column in SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY.
<group>
not currently used, specify NULL when calling procedure.
<rank-number>
not currently used, specify NULL when calling procedure.
<condition>
text of the label condition. Should not include WHERE clause.

Returns

NULL
if label was successfully created.
<error>
error message string in the case of failure to create label.

Example:

kai#COMPUTE_WH@SUNDECK.(no schema)>call ADMIN.CREATE_LABEL(
                                       'compilation_time_longer_than_30_seconds',              
                                       NULL,                   
                                       NULL,                   
                                       'COMPILATION_TIME > 30000'
                                      );
+--------------+                                                                
| CREATE_LABEL |
|--------------|
| NULL         |
+--------------+
1 Row(s) produced. Time Elapsed: 17.627s