Consider table1
and table2
.
table1
is having Column1
with value 'some_string Date: 00:30 05/16/2018 '
table2
is having Column2
with value 'some_string Date: 07-JUN-2018 '
Now I need to update both table1
and table2
where requirement is to first find the date from given string value and then convert that date into format 'HH24:MI:ss MM/DD/YYYY'
Here, problem is need to update value on different servers where String value may have date in different format. I tried to wrote above query but it is not working.
update table2
set column2 = 'some_string Date: '
|| to_char ((SELECT SUBSTR(column2, INSTR(column2, ':') + 1) AS date_value
FROM table2),
'HH24:MI:ss MM/DD/YYYY')
|| ' ';