The
sizeof() function is common in many programming languages. You provide (most) any variable as argument, and it returns the number of bytes of storage required for that variable.
Ignoring the question +"Why?+" - How do we emulate this in PL/SQL? The
length() functions are specific to some data types (e.g. string, LOB, or raw) and numbers, non-scalar and structs are not supported.
The SQL
DUMP() function can provide a byte size length for SQL data types (including date and number, excluding user types). But this requires parsing the string returned by the function for extracting the byte size.
Am I the only one missing the old
malloc() and
move() calls using pointers? :-)