Home » SQL & PL/SQL » SQL & PL/SQL » vsize(sysdate)
vsize(sysdate) [message #262792] Tue, 28 August 2007 05:15 Go to next message
gvranjith
Messages: 3
Registered: August 2007
Junior Member
hi

when i run the query "select vsize(sysdate) from dual" i get "8", but when i do "select vsize(<<any date column>>) from <<any table>>" i am getting 7....can anyone explain....
Re: vsize(sysdate) [message #262801 is a reply to message #262792] Tue, 28 August 2007 05:24 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
According to this Link it must have got something to do with stored dates and dates "in memory".

A little test confirms this suspicion:
SQL> CREATE TABLE yourtable(in_date DATE)
  2  /

Table created.

SQL> INSERT INTO yourtable
  2  VALUES      (TO_DATE ('3/8/2007 4:37:12 AM', 'mm/dd/yyyy HH:MI:SS AM
  3              );

1 row created.

SQL>
SQL> col stored format a36
SQL> col sys_dt format a36
SQL> col in_mem format a36
SQL> SELECT dump(in_date) stored
  2  FROM   yourtable
  3  /

STORED
------------------------------------
Typ=12 Len=7: 120,107,3,8,5,38,13

SQL>
SQL> SELECT dump(sysdate) sys_dt
  2  FROM   dual
  3  /

SYS_DT
------------------------------------
Typ=13 Len=8: 215,7,8,28,12,22,19,0

SQL>
SQL> SELECT dump(  TO_DATE ('12/31/9999 11:59:59 PM'
  2                        , 'mm/dd/yyyy HH:MI:SS AM')) in_mem
  3  FROM yourtable
  4  /

IN_MEM
------------------------------------
Typ=13 Len=8: 15,39,12,31,23,59,59,0

SQL>
SQL> DROP TABLE yourtable PURGE
  2  /

Table dropped.

SQL>


MHE
Previous Topic: Problem with a bracket
Next Topic: PL/SQL Tables
Goto Forum:
  


Current Time: Sat Dec 03 20:34:07 CST 2016

Total time taken to generate the page: 0.03919 seconds