- Categories:
Semi-structured and structured data functions (Type Predicates)
IS_CHAR , IS_VARCHAR¶
Returns TRUE if its VARIANT argument contains a string value.
These functions are synonymous.
- See also:
Syntax¶
Arguments¶
variant_exprAn expression that evaluates to a value of type VARIANT.
Returns¶
Returns a BOOLEAN value or NULL.
Returns TRUE if the VARIANT value contains a string value. Otherwise, returns FALSE.
If the input is NULL, returns NULL without reporting an error.
Examples¶
The following examples use the IS_VARCHAR function.
Use the IS_VARCHAR function in a WHERE clause¶
Create and fill the vartab table. The INSERT statement uses the PARSE_JSON function to insert
VARIANT values in the v column of the table.
Query the data. The query uses the TYPEOF function to show the data types of the values stored in the VARIANT column.
Show the string values in the data by using the IS_VARCHAR function in a WHERE clause:
Use the IS_VARCHAR function in a SELECT list¶
Create and fill the multiple_types table. The INSERT statement uses the TO_VARIANT function to insert
VARIANT values in the columns.
Query the data using the TYPEOF function to show the data types of the values stored in the VARIANT values.
Show whether a column contains string values in the data by using the IS_VARCHAR function in a SELECT list: