0

I have a column named date_col of data-type date. What's wrong with this query?

update test set date_col = to_date(sysdate,'DD-Mon-YYYY HH24:MI:SS')

Only date mon and yy is visible. not the time.

How can I make it work?

2
  • Try, SELECT TO_CHAR(date_col, 'DD-MON-YYYY HH24:MI:SSxFF') From Table Commented Sep 4, 2012 at 6:50
  • Then edit your post and remove this - only date mon and yy is visible Commented Sep 4, 2012 at 6:54

1 Answer 1

2

SYSDATE is yet a date. You don't need to cast SYSDATE to date type because it is a date_

update test 
set date_col = sysdate

To see time fraction use to_char:

select to_char(date_col, 'HH24 MI')
from test;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.