Solved

How many bytes for Oracle datatype timestamp and number.

Posted on 2009-04-06
5
2,747 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 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 74

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 74

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many‚Ķ
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

710 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