TYPEOF()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns a string describing the type of a value.
USAGE
TYPEOF(value)
Argument Name | Description |
---|---|
| 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
.
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 |
+--------------------------+--------------+