Solved

How many bytes for Oracle datatype timestamp and number.

Posted on 2009-04-06
5
2,718 Views
Last Modified: 2013-12-18
How many bytes should be counted for Oracle datatype timestamp/date and numbers? What is number(8,2)? For example,
PHONE#    char(10)
is counted 10 bytes, but for
Arrive_time     timestamp
how many bytes to be counted for timestamp?
0
Comment
Question by:jl66
  • 3
  • 2
5 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 24080657
13 bytes in a timestamp...

select vsize(systimestamp), vsize(sysdate) from dual

a number will use the fewest number of bytes needed to store the value with a minimum of 2
regardless of precision or scale


0
 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 500 total points
ID: 24080722
actually
11 bytes for timestamp
13 bytes for timestamp with time zone

numer(8,2) will vary from 0 (for null) or 2-5 if populated
0
 

Author Comment

by:jl66
ID: 24081183
Thanks for the info. How did you get "numer(8,2) will vary from 0 (for null) or 2-5 if populated"?
0
 

Author Comment

by:jl66
ID: 24081377
How to get "11 bytes for timestamp"?
0
 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 500 total points
ID: 24081457

select vsize(arrive_time) from your_table

systimestamp is actually a "timestamp with time zone" type, sorry for the confusion.

null is 0 simply by nature of being NULL.  :)

you can check the size of your data by populating your number(8,2) column with data and examining it.

You'll see the smallest it ever gets is 2 bytes, the largest is 5 bytes.

select your_column,vsize(your_column) from your_table

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now