String Functions

This page lists the string functions that are available in the GSQL query language.

gsql_uuid_v4()

Syntax

gsql_uuid_v4()

Description

Generates and returns a version-4 universally unique identifier(UUID).

Return type

STRING

Parameters

None.

lower()

Syntax

lower(str)

Description

Returns the input string with all letters in lowercase.

Return type

STRING

Parameters

Parameter

Description

Data type

str

The string to convert to lowercase

STRING

Example

lower("GSQL") -> "gsql"

trim()

Syntax

trim( [ [ LEADING | TRAILING | BOTH ] [removal_char FROM] ] str )

Description

Trims characters from the leading and/or trailing ends of a string.

By using one of the keywords LEADING, TRAILING, or BOTH, the user can specify that characters are to be removed from the left end, right end, or both ends of the string, respectively. If none of these keywords is used, the function will remove from both ends.

Return type

STRING

Parameters

Parameter

Description

Data type

removal_char

Optional. The character to remove. If removal_char is not specified, the function will remove whitespaces, including spaces, tabs, and new lines. If removal_char is specified, the user must also write the keyword FROM between removal_char and str.

STRING

str

A string value.

STRING

Example

trim("  Abc   ") => "Abc"
trim( LEADING " a A   ") => "a A   "
trim( TRAILING "a" FROM "aa ABC aaa") => "aa ABC "

upper()

Syntax

upper(str)

Description

Returns the input string with all letters in uppercase.

Return type

STRING

Parameters

Parameter

Description

Data type

str

The string to convert to uppercase

STRING

Example

upper("gsql") -> "GSQL"

Last updated