Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to insert default time with milliseconds

936666Jul 3 2012 — edited Jul 3 2012
How to insert default time with milliseconds

I tried with two ways but not able to insert millisecond

CASE:1

Command> create table Test (i int,h timestamp default TO_CHAR(SYSDATE, 'DD-MON-
YYYY HH:MI:SS:SSSSS'));

1001: Syntax error in SQL statement before or at: "(", character position: 53
... table Test (i int,h timestamp default TO_CHAR(SYSDATE, 'DD-MON-YY...
The command failed.

-----------------------------------------------------------------------------------------------------------------------------------------------------------
CASE:2

Command> create table Test (i int,h timestamp default Sysdate );

Command> Insert into test values (1,TO_CHAR(SYSDATE, 'YYYY-MM-DD HH:MI:SS:SSSSS'));
2813: Error converting from character string '2012-07-03 10:58:56:395366' to Oracle timestamp
The command failed.

I need to insert the data with default time with milliseconds

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2012
Added on Jul 3 2012
3 comments
3,225 views