EXPORT_SET()
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 representation of a bits argument using the given values for on and off.
USAGE
EXPORT_SET(bits, on, off[, separator[, num_bits]])
Argument Name | Description |
---|---|
| The bits to be interpreted |
| The string to use for "on" bits |
| The string to use for "off" bits |
| Optional. The separator to use when concatenating. Default: "," |
| Optional. The number of bits to interpret. Default: 64 |
DETAILS
EXPORT_SET()
is a string function that returns a string representation of a bits argument, using the given values for on and off.
The bits are examined from low-order to high-order, converting each bit into either the on
or off
string.
A NULL
is returned if any of the function arguments is NULL
.
EXAMPLES
SELECT EXPORT_SET(2, 'Y', 'N', '|', 3);
+---------------------------------+
| EXPORT_SET(2, 'Y', 'N', '|', 3) |
+---------------------------------+
| N|Y|N |
+---------------------------------+
SELECT EXPORT_SET(18, 'Y', 'N', '', 10);
+----------------------------------+
| EXPORT_SET(18, 'Y', 'N', '', 10) |
+----------------------------------+
| NYNNYNNNNN |
+----------------------------------+
SELECT EXPORT_SET(3, '1', '', ',', 5);
+--------------------------------+
| EXPORT_SET(3, '1', '', ',', 5) |
+--------------------------------+
| 1,1,,, |
+--------------------------------+
SELECT EXPORT_SET(3, '1', '0', '', 5);
+--------------------------------+
| EXPORT_SET(3, '1', '0', '', 5) |
+--------------------------------+
| 11000 |
+--------------------------------+