?
Solved

How many bytes for Oracle datatype timestamp and number.

Posted on 2009-04-06
5
Medium Priority
?
2,792 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 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 74

Assisted Solution

by:sdstuber
sdstuber earned 2000 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 74

Assisted Solution

by:sdstuber
sdstuber earned 2000 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
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.

719 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