Solved

Oracle Timestamp size ?

Posted on 2006-06-16
5
5,333 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.

Question has a verified solution.

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

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…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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 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.

920 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

15 Experts available now in Live!

Get 1:1 Help Now