Umm, Hello, can someone tell me how many bytes takes Date Time format in Oracle SQL pls ?
I tryed to find it with google, but i couldnt find it. Thank for answer.
Umm, Hello, can someone tell me how many bytes takes Date Time format in Oracle SQL pls ?
I tryed to find it with google, but i couldnt find it. Thank for answer.
You can use DUMP
function to retrive information about expression value, like this SELECT DUMP(SYSDATE,10) FROM dual
and it says Typ=13 Len=8: 223,7,4,23,14,17,41,0
, so 8 bytes.
From oracle docs
http://docs.oracle.com/cd/B28359_01/server.111/b28286/functions048.htm#SQLRF00635
DUMP returns a VARCHAR2 value containing the datatype code, length in bytes, and internal representation of expr. The returned result is always in the database character set.
Aslo, there are two different raw forms for DATEs in Oracle: https://community.oracle.com/thread/2257401
Type 12 (7 bytes) is used for DATE columns
Type 13 (8 bytes) is used for other DATE expressions, including DATE literals and results for date arithmetic and functions.
The size of a date time format is fixed at 7 bytes, see Oracle's documentation or alternatively run this:
select vsize(sysdate) from dual
or this:
create table test (dt date);
select data_length from user_tab_columns where table_name = 'ZTEST';