Purpose
This function returns the size (in bytes) of the expr parameter.
Syntax
VSIZE (expr)
Parameters
expr can be a value or expression of a numeric data type (NUMBER, FLOAT, BINARY_FLOAT, or BINARY_DOUBLE) or a character data type (CHAR, VARCHAR2, NCHAR, or NVARCHAR2).
Return type
Returns a value of the
NUMBERtype.If
exprisNULL, the function returnsNULL.
Examples
Query the number of bytes of 123456, ABCDEF, and People's Republic of China by using the VSIZE function.
obclient> SELECT VSIZE(123456),VSIZE('ABCDEF'),VSIZE ('People's Republic of China') FROM DUAL;
+---------------+-----------------+--------------------------------+
| VSIZE(123456) | VSIZE('ABCDEF') | VSIZE('People's Republic of China') |
+---------------+-----------------+--------------------------------+
| 8 | 6 | 21 |
+---------------+-----------------+--------------------------------+
1 row in set