id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
snowflake_docs/system_get_tag_on_current_table_4_0.txt
Usage notes ¶ * Currently, this function can only be used in a masking policy or row access policy condition to dynamically evaluate the tag string value set on a table. Snowflake returns an error while using the function in a SELECT query, view, materialized view, or a user-defined function (UDF). * Note that ...
snowflake_docs/current_session_3_0.txt
Returns ¶ The data type of the returned value is VARCHAR.
snowflake_docs/ifnull_5_0.txt
label-data-type-explicit-casting) the argument to a type that can represent the value.
snowflake_docs/database_refresh_history_0_0.txt
/ 1. Data Loading 4. Data Generation 6. Data Conversion 9. ML-Powered Analysis 11. Object Modeling 13. Semi-Structured Queries 15. Query Results 17. Query Profile 19. User Login 22. Queries 26. Wareho...
snowflake_docs/variance_pop_6_0.txt
Examples ¶ Was this page helpful? Yes No Inc. All Rights Reserved . On this page 1. Syntax 2. Arguments 3. Returns 4. Usage Notes 5. Examples Language : **English**
snowflake_docs/table_constraints_1_0.txt
TABLE_CONSTRAINTS View ¶ This Information Schema view displays a row for each referential integrity constraint defined for the tables in the specified (or current) database. For more information about referential integrity constraints, see [ See also:
snowflake_docs/months_between_5_0.txt
Usage Notes ¶ * If date (or timestamp) d1 represents an earlier point in time than d2, then ` MONTHS_BETWEEN(d1, d2) ` returns a negative value; otherwise it returns a positive value. More generally, swapping the inputs reverses the sign: ` MONTHS_BETWEEN(d1, d2) ` = ` -MONTHS_BETWEEN(d2, d1) ` . * You ca...
snowflake_docs/commands-table_9_0.txt
View ¶
snowflake_docs/array_construct_compact_3_0.txt
Arguments ¶ ` expr
snowflake_docs/alter-aggregation-policy_1_0.txt
ALTER AGGREGATION POLICY ¶ This feature requires Enterprise Edition (or higher). To inquire about upgrading, please contact [ Snowflake Support Snowflake-Lodge) . Available to all accounts that are Enterprise Edition (or higher). To inquire about upgrading, please contact [ Snowflake Support Snowflake-Lodge) . Repla...
snowflake_docs/identifiers-syntax_2_0.txt
Unquoted identifiers ¶ If an identifier is not enclosed in double quotes, it must begin with a letter or underscore ( ` _ ` ) and cannot contain extended characters or blank spaces. The following are all examples of valid identifiers; however, the case of the characters in these identifiers would not be preserved: ...
snowflake_docs/st_geographyfromwkb_4_0.txt
Syntax ¶ ST_GEOGRAPHYFROMWKB( <varchar_or_binary_expression> [ , <allow_invalid> ] ) ST_GEOGFROMWKB( <varchar_or_binary_expression> [ , <allow_invalid> ] ) ST_GEOGRAPHYFROMEWKB( <varchar_or_binary_expression> [ , <allow_invalid> ] ) ST_GEOGFROMEWKB( <varchar_or_binary_expression> [ , <allow_invalid> ...
snowflake_docs/charindex_9_0.txt
BINARY Expressions ¶ Note that because the values below are hexadecimal representations, a single BINARY byte is represented as two hex digits. In this example, the returned value is 3 because ‘EF’ matches the 3rd byte (the first byte is ‘AB’; the second byte is ‘CD’, and the third byte is ‘EF’): > > SELECT CHAR...
snowflake_docs/array_compact_4_0.txt
Usage Notes ¶ * Semi-structured data (e.g. JSON data) can contain explicit null values, which are distinct from SQL NULLs. A null value in semi-structured data indicates a missing value. * ` _ array1 _ ` should be either an ARRAY data type or a VARIANT data type containing an array value. * If the argument ...
snowflake_docs/show-shares-in-failover-group_0_0.txt
/ 4. Replication 11. Failover/Failback 18. Client Redirect SHOW SHARES IN FAILOVER GROUP
snowflake_docs/to_object_4_0.txt
Arguments ¶ ` _ expr _ ` An expression that evaluates to a VARIANT that contains an OBJECT.
snowflake_docs/query_history_5_1.txt
_SENT_ROWS | NUMBER | The total number of rows that this query sent in all calls to all remote services. EXTERNAL_FUNCTION_TOTAL_RECEIVED_ROWS | NUMBER | The total number of rows that this query received from all calls to all remote services. EXTERNAL_FUNCTION_TOTAL_SENT_BYTES | NUMBER | The total number of bytes t...
snowflake_docs/show-privileges_3_0.txt
Parameters ¶ ` _ name _ ` Specifies the name of the application.
snowflake_docs/binary-input-output_11_0.txt
Example Input/Output ¶ ` BINARY ` input/output can be confusing because “what you see is not necessarily what you get”. Consider, for example, the following sequence of code: > > CREATE TABLE binary_table (v VARCHAR, b BINARY); > INSERT INTO binary_table (v, b) > SELECT 'AB', TO_BINARY('AB'); > > ...
snowflake_docs/data-types-structured_12_0.txt
Explicitly Casting a Structured Type to a Semi-Structured Type ¶ To explicitly cast a structured type to a semi-structured type, you can [ call ). Note TRY_CAST is not supported with structured types. Structured Type | Semi-Structured Type That You Can Cast To ---|--- Structured ARRAY | ARRAY MAP or structured...
snowflake_docs/xmlget_6_0.txt
label-data-type-object) . See the Usage Notes for more details.
snowflake_docs/drop-replication-group_3_0.txt
Syntax ¶ DROP REPLICATION GROUP [ IF EXISTS ] <name> Copy
snowflake_docs/database_refresh_progress_6_0.txt
Examples ¶ Retrieve the current progress of the database refresh for the ` mydb1 ` database: > > select * > from table(information_schema.database_refresh_progress(mydb1)); > > > Copy Retrieve the current progress of a database refresh by query ID: > > select * > from > table(information_schema.da...
snowflake_docs/result_scan_9_1.txt
Copy
snowflake_docs/show-objects_0_0.txt
/ 2. Table 13. Dynamic Table 19. Event Table 24. External Table 30. Hybrid Table 36. Iceberg Table 43. View 49. Materialized View 56. Sequence SHOW OBJECTS
snowflake_docs/array_size_4_0.txt
Usage Notes ¶ * Takes an ARRAY value as input and returns the size of the array (i.e. the largest index + 1). arrays) array, this means that the size includes the undefined elements as well as the defined elements. * A NULL argument returns NULL as a result.
snowflake_docs/alter-table_28_1.txt
---------+-------------------+-----------+-------+---------+-------------+------------+-------+----------------------------------------------------------+-----------------------+ | name | type | kind | null? | default | primary key | unique key | check | expression ...
snowflake_docs/commands-stream_1_0.txt
Stream and Task Commands ¶ Stream and task commands enable you to manage your streams and tasks.
snowflake_docs/functions-table_7_0.txt
Using a Table Function in the FROM clause ¶ A table contains a set of rows. Similarly, a table function returns a set of rows. Both tables and table functions are used in contexts that expect a set of rows. Specifically, table functions are used in the [ FROM To help the SQL compiler recognize a table function as a ...
snowflake_docs/drop-failover-group_3_0.txt
Parameters ¶ ` _ name _ ` Specifies the identifier for the failover group.
snowflake_docs/create-security-integration-api-auth_13_0.txt
Examples ¶ Create a security integration named ` servicenow_oauth ` to connect Snowflake to the ServiceNow instance named ` myinstance ` using OAuth with the code grant flow: > > CREATE SECURITY INTEGRATION servicenow_oauth > TYPE = api_authentication > AUTH_TYPE = oauth2 > OAUTH_CLIENT_AUTH_...
snowflake_docs/show-integrations_10_0.txt
Examples ¶ Show all notification integrations: > > SHOW NOTIFICATION INTEGRATIONS; > > > Copy Show all the integrations whose name starts with ` line ` that you have privileges to view: > > SHOW INTEGRATIONS LIKE 'line%'; > > > Copy Was this page helpful? Yes No Inc. All Rights Reserved . On this pag...
snowflake_docs/approx_top_k_estimate_2_0.txt
Syntax ¶ APPROX_TOP_K_ESTIMATE( <state> [ , <k> ] ) Copy
snowflake_docs/show-packages-policies_8_0.txt
label-access-control-securable-objects) , see [ Overview of
snowflake_docs/system_client_version_info_4_0.txt
Returns ¶ Return a string containing a JSON array of objects. Each object contains information about a specific client and driver, such as SnowSQL, the JDBC driver, and so on. Each JSON object contains the following name/value pairs: { "clientId": "DOTNETDriver", "clientAppId": ".NET", "minimum...
snowflake_docs/st_makepolygonoriented_1_0.txt
ST_MAKEPOLYGONORIENTED ¶ geography) object that represents a Polygon without holes. The function uses the specified LineString as the outer loop. This function does not attempt to correct the orientation of the loop, thus allowing for the creation of Polygons that span more than half of the globe. those large shapes...
snowflake_docs/ilike_any_3_0.txt
Arguments ¶ **Required:** ` _ subject _ ` The string to compare to the pattern(s). ` _ pattern
snowflake_docs/drop-password-policy_1_0.txt
DROP PASSWORD POLICY ¶ Removes a password policy from the system. See also: management.html
snowflake_docs/drop-iceberg-table_5_0.txt
label-access-control-overview-privileges) at a minimum: Privilege | Object | Notes ---|---|--- OWNERSHIP | Iceberg table | OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the [ role (or any role with the MANAGE GRANTS...
snowflake_docs/with_10_0.txt
Column Lists in a Recursive CTE ¶ There are three column lists in a recursive CTE: * ` _ cte_column_list _ ` * ` _ anchor_column_list _ ` (in the anchor clause) * ` _ recursive_column_list _ ` (in the recursive clause) A recursive CTE can contain other column lists (e.g. in a subquery), but these three co...
snowflake_docs/data-types-numeric_14_0.txt
Examples of Floating-Point Data Types in a Table ¶ CREATE OR REPLACE TABLE test_float(d DOUBLE, f FLOAT, dp DOUBLE PRECISION, r REAL ); DESC TABLE test_f...
snowflake_docs/complete-snowflake-cortex_0_0.txt
/ 1. General Manipulation 34. Case Conversion 38. Regular Expression Matching 48. Other Matching/Comparison 66. Compression/Decompression 70. Encoding/Decoding 81. Cryptographic/Checksum 93. Hash (Non-cryptographic) 96. Co...
snowflake_docs/drop-catalog-integration_8_0.txt
Usage notes ¶ * Dropped catalog integrations cannot be recovered; they must be recreated.
snowflake_docs/create-schema_2_0.txt
Syntax ¶ CREATE [ OR REPLACE ] [ TRANSIENT ] SCHEMA [ IF NOT EXISTS ] <name> [ CLONE <source_schema> [ { AT | BEFORE } ( { TIMESTAMP => <timestamp> | OFFSET => <time_difference> | STATEMENT => <id> } ) ] ] [ WITH MANAGED ACCESS ] [ DATA_RETENTION_TIME_IN_DAYS = <integer> ] [ M...
snowflake_docs/drop-replication-group_2_0.txt
label-replication-and-failover-groups) from the account. See also: replication-groups)
snowflake_docs/localtime_5_0.txt
Usage Notes ¶ * To comply with ANSI standards, this function can be called without parentheses.
snowflake_docs/system_whitelist_privatelink_3_0.txt
Arguments ¶ None.
snowflake_docs/accounts_2_0.txt
Columns ¶ Column | Data Type | Description ---|---|--- ORGANIZATION_NAME | VARCHAR | Name of the organization. ACCOUNT_NAME | VARCHAR | User-defined name that identifies an account within the organization. CREATED_ON | TIMESTAMP | Date and time when the account was created. REGION | VARCHAR | Snowflake Reg...
snowflake_docs/min_2_0.txt
Syntax ¶ **Aggregate function** MIN( <expr> ) Copy **Window function** MIN( <expr> ) [ OVER ( [ PARTITION BY <expr1> ] [ ORDER BY <expr2> [ <window_frame> ] ] ) ] Copy For details about ` _ window_frame _ ` syntax, see [ Window Frame Syntax and
snowflake_docs/copy-files_7_0.txt
label-access-control-overview-privileges) (depending on the source and target locations) at a minimum: Privilege | Object | Notes ---|---|--- USAGE | External stage | Required on a source or target external stage. READ | Internal named stage | Required on a source internal stage. WRITE | Internal named stage | ...
snowflake_docs/parameters_53_0.txt
JDBC_TREAT_DECIMAL_AS_INT ¶ Type : Session — Can be set for Account » User » Session Data Type : Boolean Description : Specifies how JDBC processes columns that have a scale of zero ( ` 0 ` ). Values : ` TRUE ` : JDBC processes a column whose scale is zero as BIGINT. ` FALSE ` : JDBC processes a column whose ...
snowflake_docs/md5_binary_1_0.txt
MD5_BINARY ¶ Returns a 16-byte ` BINARY ` value containing the 128-bit MD5 message digest. See also:
snowflake_docs/alter-model-modify-version_0_0.txt
/ 1. Models 6. Versions MODEL ... MODIFY VERSION
snowflake_docs/cast_9_0.txt
Examples ¶ Convert a string containing a number to a decimal with specified scale (2): > > SELECT CAST('1.2345' AS DECIMAL(15,2)); > +---------------------------------+ > | CAST('1.2345' AS DECIMAL(15,2)) | > |---------------------------------| > | 1.23 | > +-------...
snowflake_docs/account-usage_3_0.txt
Differences Between Account Usage and Information Schema ¶ The Account Usage views and the corresponding views (or table functions) in structures and naming conventions, but with some key differences, as described in this section: Difference | Account Usage | Information Schema ---|---|--- Includes dropped objec...
snowflake_docs/desc-authentication-policy_6_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/create-custom-classifier_11_0.txt
Methods ¶ You can call the following methods on the custom classification instance that you create:
snowflake_docs/create-api-integration_14_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/to_date_4_0.txt
label-date-time-input-output-supported-formats-for-auto- detection) , which specifies that Snowflake should automatically detect the format to use. For more information, see [ Date and Time Formats in Conversion The default is the current value of the [ DATE_INPUT_FORMAT AUTO).
snowflake_docs/show-masking-policies_8_0.txt
Usage notes ¶ * The command does not require a running warehouse to execute. * The value for ` LIMIT _ rows _ ` cannot exceed ` 10000 ` . If ` LIMIT _ rows _ ` is omitted, the command results in an error if the result set is larger than 10K rows. To view results for which more than 10K records exist, eith...
snowflake_docs/exp_2_0.txt
Syntax ¶ EXP( <real_expr> ) Copy
snowflake_docs/desc-result_1_0.txt
DESCRIBE RESULT ¶ Describes the columns in the result of a query. Snowflake persists the result of a query for a period of time, after which the result is purged. The query can be from the current session or any of your other sessions, including past sessions, as long as the limited period has not elapsed. This peri...
snowflake_docs/system_generate_saml_csr_3_0.txt
Arguments ¶ ` _ name _ ` The name of the SAML2 security integration to generate the CSR. Required. ` _ DN _ ` The distinguished name to be used the CSR. Note that a DN is a string of relative DNs separated by commas. For example: > ` 'cn=juser, ou=dev, ou=people, o=eng, dc=com' ` Optional. If missing, the DN ...
snowflake_docs/show-replication-groups_4_0.txt
Usage Notes ¶ * Executing this command requires a role with any one of the following privileges on a replication group: * MONITOR * OWNERSHIP * REPLICATE * The output of SHOW REPLICATION GROUPS includes groups of types ` FAILOVER ` and ` REPLICATION ` .
snowflake_docs/dayname_2_0.txt
Syntax ¶ DAYNAME( <date_or_timestamp_expr> ) Copy
snowflake_docs/grants_to_users_1_0.txt
GRANTS_TO_USERS view ¶ This Account Usage view can be used to query the roles that have been granted to a user.
snowflake_docs/show-connections_4_0.txt
Usage Notes ¶ * The command does not require a running warehouse to execute. * Only account administrators (users with the ACCOUNTADMIN role) can execute this SQL command.
snowflake_docs/first_value_5_0.txt
Examples ¶ This shows a simple query using ` FIRST_VALUE() ` . This query contains two ` ORDER BY ` sub-clauses, one to control the order of rows in each partition, and one to control the order of the output of the full query. SELECT column1, column2, FIRST_VALUE(column2) O...
snowflake_docs/show-dynamic-tables_0_0.txt
/ 2. Table 13. Dynamic Table 19. Event Table 24. External Table 30. Hybrid Table 36. Iceberg Table 43. View 49. Materialized View 56. Sequence SHOW DYNAMIC TABLES
snowflake_docs/array_remove_at_5_0.txt
Usage Notes ¶ * If the absolute value of ` _ position _ ` exceeds the length of ` _ array _ ` , the function returns ` _ array _ ` without any elements removed.
snowflake_docs/task_dependents_7_0.txt
Examples ¶ Retrieve the list of direct child tasks for the ` mydb.myschema.mytask ` task: > > select * > from table(information_schema.task_dependents(task_name => > 'mydb.myschema.mytask', recursive => false)); > > > Copy Was this page helpful? Yes No Inc. All Rights Reserved . On this page 1. Syn...
snowflake_docs/st_asgeojson_7_0.txt
GEOGRAPHY Examples ¶ The following example demonstrates the ST_ASGEOJSON function: > > create table geospatial_table (id INTEGER, g GEOGRAPHY); > insert into geospatial_table values > (1, 'POINT(-122.35 37.55)'), (2, 'LINESTRING(-124.20 42.00, -120.01 > 41.99)'); > > > Copy > > > select st_...
snowflake_docs/drop-schema_1_0.txt
DROP SCHEMA ¶ Removes a schema from the current/specified database. See also:
snowflake_docs/auto_refresh_registration_history_3_0.txt
Arguments ¶ All of the arguments are optional. ` DATE_RANGE_START => _ constant_expr _ ` , . ` DATE_RANGE_END => _ constant_expr _ ` The date/time range of the billing window: History is displayed in increments of 5 minutes, 1 hour, or 24 hours (depending on the length of the specified range). ` OBJECT_TYPE =...
snowflake_docs/undrop-database_3_0.txt
Parameters ¶ ` _ name _ ` Specifies the identifier for the database to restore. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
snowflake_docs/show-columns_5_0.txt
Output ¶ The command output provides column properties and metadata in the following columns: Column | Description ---|--- ` table_name ` | Name of the table the columns belong to. ` schema_name ` | Schema for the table. ` column_name ` | Name of the column. ` data_type ` | Column data type and applica...
snowflake_docs/system_get_task_graph_config_4_0.txt
Examples ¶ -- Create a task which defines and then uses configuration CREATE OR REPLACE TASK root_task_with_config WAREHOUSE=mywarehouse SCHEDULE='10 m' CONFIG=$${"output_dir": "/temp/test_directory/", "learning_rate": 0.1}$$ AS BEGIN LET OUTPUT_DIR STRING := SYSTEM$GET_TASK_GRAPH_C...
snowflake_docs/row_number_1_0.txt
ROW_NUMBER ¶ Returns a unique row number for each row within a window partition. The row number starts at 1 and continues up sequentially.
snowflake_docs/use-database_4_0.txt
Usage Notes ¶ * The ` DATABASE ` keyword does not need to be specified.
snowflake_docs/alter-external-volume_9_0.txt
label-access-control-securable-objects) , see [ Overview of
snowflake_docs/parameters_33_0.txt
DEFAULT_DDL_COLLATION ¶ Type : Object (for databases, schemas, and tables) — Can be set for Account » Database » Schema » Table Data Type : String Description : Sets the default collation used for the following DDL operations: Setting this parameter forces all subsequently-created columns in the affected objects ...
snowflake_docs/show-integrations_0_0.txt
/ 1. General 7. API 10. Catalog 15. External access 18. Notification 21. Security 25. Storage INTEGRATIONS
snowflake_docs/table_constraints_0_0.txt
/ TABLE_CONSTRAINTS
snowflake_docs/desc-warehouse_1_0.txt
DESCRIBE WAREHOUSE ¶ Describes the warehouse. For example, shows the date that the warehouse was created. DESCRIBE can be abbreviated to DESC. See also: warehouses)
snowflake_docs/system_show_budgets_in_account_2_0.txt
Syntax ¶ SYSTEM$SHOW_BUDGETS_IN_ACCOUNT() Copy
snowflake_docs/add_months_5_0.txt
Usage Notes ¶ * For ADD_MONTHS only, if the original day is the last day of the month, the result day of month will be the last day of the result month. * ` _ num_months_expr _ ` can be a positive or negative integer to either add or subtract months, respectively.
snowflake_docs/data-type-conversion_7_0.txt
Data Types that Can Be Cast ¶ The table below shows the valid data type conversions in Snowflake. The table also shows which coercions Snowflake can perform automatically. Note call the appropriate conversion function. For example, if you cast a NUMBER to function. The usage notes for each conversion function apply ...
snowflake_docs/time_from_parts_4_0.txt
Usage Notes ¶ TIME_FROM_PARTS is typically used to handle values in “normal” ranges (e.g. hours 0-23, minutes 0-59), but it also handles values from outside these ranges. This allows, for example, choosing the N-th minute in a day, which can be used to simplify some computations.
snowflake_docs/alter-service_6_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/system_get_privatelink_config_2_0.txt
Syntax ¶ SYSTEM$GET_PRIVATELINK_CONFIG() Copy
snowflake_docs/editdistance_3_0.txt
Arguments ¶ **Required:** ` _ string_expr1 _ ` , . ` _ string_expr2 _ ` The input strings. **Optional:** ` _ max_distance _ ` Integer expression that specifies the maximum distance to compute. When the distance between the strings exceeds this number, the function stops computing the distance and just returns t...
snowflake_docs/h3_point_to_cell_0_0.txt
/ 1. Conversion, Input, Parsing 14. Conversion, Output, Formatting 23. Constructor 32. Accessor 44. Relationship and Measurement 61. Transformation 75. Utility 77. H3 geospatial) H3_POINT_TO_CELL Categories:
snowflake_docs/st_perimeter_3_0.txt
Arguments ¶ ` _ geography_or_geometry_expression _ ` The argument must be of type GEOGRAPHY or GEOMETRY.
snowflake_docs/create-table_12_3.txt
haracter ( ` ' ` ), or double quote character ( ` " ` ). To use the single quote character, use the octal or hex representation ( ` 0x27 ` ) or the double single-quoted escape ( ` '' ` ). When a field contains this character, escape it using the same character. For example, if the value is the double quote characte...
snowflake_docs/indexes_3_0.txt
Usage Notes ¶ Latency for the view may be up to 180 minutes (3 hours). Was this page helpful? Yes No Inc. All Rights Reserved . On this page 1. Columns 2. Usage Notes Related content Language : **English**
snowflake_docs/system_registry_list_images_4_0.txt
Returns ¶ Returns a JSON object listing all the images.
snowflake_docs/show-primary-keys_6_0.txt
Examples ¶ show primary keys; show primary keys in account; show primary keys in database; show primary keys in database my_database; show primary keys in schema; show primary keys in schema my_schema; show primary keys in schema my_database.my_schema; show primary keys in my_table; ...
snowflake_docs/commands-data-governance_3_0.txt
Row access policy ¶
snowflake_docs/match_recognize_11_0.txt
ROW(S) PER MATCH: Specifying the Rows to Return ¶ { ONE ROW PER MATCH | ALL ROWS PER MATCH [ { SHOW EMPTY MATCHES | OMIT EMPTY MATCHES | WITH UNMATCHED ROWS } ] } Copy Specifies which rows are returned for a successful match. This subclause is optional. * ` ALL ROWS PER MATCH ` : Return al...
snowflake_docs/map_contains_key_6_0.txt
Examples ¶ The function searches for the ` k1 ` key and finds it in the map: SELECT MAP_CONTAINS_KEY( 'k1',{'k1':'v1','k2':'v2','k3':'v3'}::MAP(VARCHAR,VARCHAR)) AS contains_key; Copy +--------------+ | CONTAINS_KEY | |--------------| | True | +--------------+ The functio...