Solved

How many bytes for Oracle datatype timestamp and number.

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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
clob to char in oracle 3 64
1 FROM DUAL wont work with additional columns ?? 4 46
pivot rows to columns 1 36
oracle numeric condition check 4 27
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
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 setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

820 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