René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
vsize [Oracle SQL] | ||
vsize(some-expression)
vsize is a function that returns the size of some-expression measured in bytes.
some-expression can also be a column name.
Size of a number:
Size of a string:
select vsize('what is my size') from dual; VSIZE('WHATISMYSIZE') --------------------- 15
Size of columns:
create table vsize_test ( a number, b varchar2(10), c date ); insert into vsize_test values ( 1,'foo' , sysdate ); insert into vsize_test values ( 1001,'aladin', sysdate-10000); insert into vsize_test values (209.209, null , sysdate+10000); select vsize(a), vsize(b), vsize(c) from vsize_test; VSIZE(A) VSIZE(B) VSIZE(C) ---------- ---------- ---------- 2 3 7 3 6 7 5 7 |