String & binary functions

This family of functions perform operations on a string input value, or binary input value (for certain functions), and return a string or numeric value.

The functions are grouped by type of operation performed.

Function NameBinary Input SupportedCollation SupportedNotes
General Manipulation
ASCII
BIT_LENGTH
CHR , CHAR
CONCAT , ||
CONCAT_WS
INSERT
LENGTH, LEN
LPAD
LTRIM
OCTET_LENGTH
PARSE_IP
PARSE_URL
REPEAT
REVERSE
RPAD
RTRIM
RTRIMMED_LENGTH
SOUNDEX
SOUNDEX_P123
SPACE
SPLITProvides partial support for collation. For details, see the documentation of the function.
SPLIT_PART
SPLIT_TO_TABLE
STRTOK
STRTOK_TO_ARRAY
STRTOK_SPLIT_TO_TABLE
TRANSLATE
TRIM
UNICODE
UUID_STRING
Full-Text Search
SEARCH
SEARCH_IP
Case Conversion
INITCAP
LOWER
UPPER
Regular Expression Matching
[ NOT ] REGEXPAlias for RLIKE.
REGEXP_COUNT
REGEXP_EXTRACT_ALLAlias for REGEXP_SUBSTR_ALL.
REGEXP_INSTR
REGEXP_LIKEAlias for RLIKE.
REGEXP_REPLACE
REGEXP_SUBSTR
REGEXP_SUBSTR_ALL
[ NOT ] RLIKE
Other Matching/Comparison
CHARINDEXAlias for POSITION. Provides partial support for collation. For details, see the documentation of the POSITION function.
CONTAINSProvides partial support for collation. For details, see the documentation of the function.
EDITDISTANCE
ENDSWITHProvides partial support for collation. For details, see the documentation of the function.
[ NOT ] ILIKECase-insensitive alternative for LIKE.
ILIKE ANYCase-insensitive alternative for LIKE ANY.
JAROWINKLER_SIMILARITY
LEFT
[ NOT ] LIKE
LIKE ALL
LIKE ANY
POSITIONProvides partial support for collation. For details, see the documentation of the function.
REPLACE
RIGHT
STARTSWITHProvides partial support for collation. For details, see the documentation of the function.
SUBSTR , SUBSTRING
Compression/Decompression
COMPRESS
DECOMPRESS_BINARY
DECOMPRESS_STRING
Encoding/Decoding
BASE64_DECODE_BINARY
BASE64_DECODE_STRING
BASE64_ENCODE
HEX_DECODE_BINARY
HEX_DECODE_STRING
HEX_ENCODE
TRY_BASE64_DECODE_BINARYError-handling version of BASE64_DECODE_BINARY.
TRY_BASE64_DECODE_STRINGError-handling version of BASE64_DECODE_STRING.
TRY_HEX_DECODE_BINARYError-handling version of HEX_DECODE_BINARY.
TRY_HEX_DECODE_STRINGError-handling version of HEX_DECODE_STRING.
Cryptographic/Checksum
MD5 , MD5_HEXIntended primarily for checksum operations. Not recommended for cryptography.
MD5_BINARYIntended primarily for checksum operations. Not recommended for cryptography.
MD5_NUMBER_LOWER64Intended primarily for checksum operations. Not recommended for cryptography.
MD5_NUMBER_UPPER64Intended primarily for checksum operations. Not recommended for cryptography.
SHA1 , SHA1_HEX
SHA1_BINARY
SHA2 , SHA2_HEX
SHA2_BINARY
Hash (Non-cryptographic)
HASHAllows data types other than string and binary. Not intended for cryptography.
HASH_AGGAllows data types other than string and binary. Not intended for cryptography.
Collation
COLLATE
COLLATION
AI Functions
AGENT_RUN (SNOWFLAKE.CORTEX)
AI_AGG
AI_CLASSIFY
AI_COMPLETE
AI_COUNT_TOKENS
AI_EMBED
AI_FILTER
AI_REDACT
AI_SENTIMENT
AI_SIMILARITY
AI_SUMMARIZE_AGG
AI_TRANSLATE
CLASSIFY_TEXT (SNOWFLAKE.CORTEX)
COMPLETE (SNOWFLAKE.CORTEX)
DATA_AGENT_RUN (SNOWFLAKE.CORTEX)
EMBED_TEXT_768 (SNOWFLAKE.CORTEX)
EMBED_TEXT_1024 (SNOWFLAKE.CORTEX)
ENTITY_SENTIMENT (SNOWFLAKE.CORTEX)
EXTRACT_ANSWER (SNOWFLAKE.CORTEX)
FINETUNE (SNOWFLAKE.CORTEX)
PARSE_DOCUMENT (SNOWFLAKE.CORTEX)
SPLIT_TEXT_MARKDOWN_HEADER (SNOWFLAKE.CORTEX)
SPLIT_TEXT_RECURSIVE_CHARACTER (SNOWFLAKE.CORTEX)
SENTIMENT (SNOWFLAKE.CORTEX)
SUMMARIZE (SNOWFLAKE.CORTEX)
TRANSLATE (SNOWFLAKE.CORTEX)
COUNT_TOKENS (SNOWFLAKE.CORTEX)
TRY_COMPLETE (SNOWFLAKE.CORTEX)
SEARCH_PREVIEW (SNOWFLAKE.CORTEX)