Solved

Oracle Timestamp size ?

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

Suggested Solutions

Title # Comments Views Activity
Oracle - SQL Script to test for bill dates 3 or more times in SAME WEEK? 11 55
Deny Oracle DBAs from Connecting  "/ as sysdba" 5 61
Clone Oracle 12c Database 5 52
exp/imp 25 73
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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.  …
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

815 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

8 Experts available now in Live!

Get 1:1 Help Now