string function (Databricks SQL)

Casts the value expr to STRING.

Syntax

string(expr)

Arguments

  • expr: An expression that can be cast to STRING.

Returns

The result matches the type of expr.

This function is a synonym for cast(expr AS STRING)

See cast function (Databricks SQL) for details.

Examples

> SELECT string(5);
 5
> SELECT string(current_date);
 2021-04-01