Solved

Oracle Timestamp size ?

Posted on 2006-06-16
5
5,321 Views
Last Modified: 2008-01-09
Hi,
I have an Oracle (9.2.0) table column that is of type Timestamp...

The DBA declared it as:

ColumnName      Type
CREATETMS       Timestamp(6)

My question is: what does this mean?     Timestamp(6)  ?
Give me an example insert value to insert a value to this column??? (should work)
I am having problem updating this Timestamp with new values from my java program....


Thanks.
_Esam.
0
Comment
Question by:_Esam
  • 3
5 Comments
 
LVL 11

Accepted Solution

by:
pennnn earned 125 total points
ID: 16923469
From the manual:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/sql_elements2a.htm#47861
---
The TIMESTAMP datatype is an extension of the DATE datatype. It stores the year, month, and day of the DATE datatype, plus hour, minute, and second values. This datatype is useful for storing precise time values. Specify the TIMESTAMP datatype as follows:

TIMESTAMP [(fractional_seconds_precision)]

where fractional_seconds_precision optionally specifies the number of digits Oracle stores in the fractional part of the SECOND datetime field. When you create a column of this datatype, the value can be a number in the range 0 to 9. The default is 6. When you specify TIMESTAMP as a literal, the fractional_seconds_precision value can be any number of digits up to 9, as follows:

TIMESTAMP'1997-01-31 09:26:50.124'
---
An example of an insert would be:
insert into my_table (timestamp_column) values (timestamp'1997-01-31 09:26:50.124');

Hope that helps!
0
 
LVL 19

Expert Comment

by:actonwang
ID: 16923479
TIMESTAMP [(<precision>)]

The TIMESTAMP datatype stores date and time information with fractional
seconds precision. The only difference between the DATE and TIMESTAMP
datatypes is the ability to store fractional seconds up to a precision of nine digits.
The default precision is 6 and can range from 0 to 9.
0
 

Author Comment

by:_Esam
ID: 16923799
>insert into my_table (timestamp_column) values (timestamp'1997-01-31 09:26:50.124');

Is this part ok:   (timestamp'1997-01-31 09:26:50.124'); ?

Should it just be:   ('1997-01-31 09:26:50.124');


_Esam
0
 

Author Comment

by:_Esam
ID: 16923851
Need an example of how to insert a darn timestamp>>>:)


Thax.
_esam.
0
 

Author Comment

by:_Esam
ID: 16923878
Sorry, I got it working now...:)

Thanks

_Esam..
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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

746 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

13 Experts available now in Live!

Get 1:1 Help Now