Skip to Main Content

SQL & PL/SQL

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!

Get date with millisecond from table

user601042Dec 18 2009 — edited Dec 18 2009
i want to get date format with milliseconds from table into variable. How to achieve this?

SQL> create table test_date (col1 date);

Table created
SQL> insert into test_date values(sysdate);

1 row inserted

SQL> commit;

Commit complete

SQL> select * from test_date;

COL1
-----------
12/18/2009


Here i have to get datewith millisecond format and put it in variable with varchar2(50) and pass this
to Java.


SQL> select to_char(COL1,'mm/dd/yyyy hh24:mi:ss.FF') from test_date;

select to_char(COL1,'mm/dd/yyyy hh24:mi:ss.FF') from test_date

ORA-01821: date format not recognized

SQL>

Thanks,
kannan
This post has been answered by RadhakrishnaSarma on Dec 18 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2010
Added on Dec 18 2009
2 comments
15,274 views