TYPEOF()

Overview

Returns a string describing the type of a value.

USAGE

TYPEOF(value)

Argument Name

Description

value

The value to analyze

DETAILS

TYPEOF() is an information function that returns a string describing the type of a value.

The return value mentions qualifiers, such as if the type can take on the NULL value and if it is UNSIGNED.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT TYPEOF(5), TYPEOF('hi');
+--------------------+--------------------------------------------+
| TYPEOF(5)          | TYPEOF('hi')                               |
+--------------------+--------------------------------------------+
| bigint(0) not null | varchar(255) CHARACTER SET latin1 not null |
+--------------------+--------------------------------------------+
SELECT TYPEOF(ENCODE('foo', 'bar')), TYPEOF(HEX('hi'));
+------------------------------+-----------------------------------+
| TYPEOF(ENCODE('foo', 'bar')) | TYPEOF(HEX('hi'))                 |
+------------------------------+-----------------------------------+
| varbinary(256)               | varchar(65535) CHARACTER SET utf8 |
+------------------------------+-----------------------------------+
SELECT TYPEOF(FROM_UNIXTIME(0)), TYPEOF(NULL);
+--------------------------+--------------+
| TYPEOF(FROM_UNIXTIME(0)) | TYPEOF(NULL) |
+--------------------------+--------------+
| datetime                 | null_type    |
+--------------------------+--------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES