I
I
impressive172020-05-22 10:28:24
Oracle
impressive17, 2020-05-22 10:28:24

How to check date format in Oracle?

I need to update only the rows where the value of the TODAY field is written without seconds, adding seconds 00::00:00 there. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Komarov, 2020-05-22
@maNULL

What is the data type of the TODAY field? DATE or VARCHAR2? If DATE, then "00:00:00" is always present unless the time is explicitly specified. If a string (although I don't understand what's the point of storing the full date in VARCHAR2) and date information in the format DD.MM.RRRR HH24:MI:SS, then something like this:

update table_name set today = today || ' 00:00:00' where length(today) = 10;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question