Purpose
The SIZEOF function returns the size, in bytes, of the parameter expr.
Syntax
VSIZE (expr)
Parameters
The 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
The procedure returns a value of the
NUMBERtype.If
exprisNULL, the function returnsNULL.
Examples
Query the number of bytes used by the 123456, ABCDEF, and People's Republic of China strings 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