I am using Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production and starting from 2 select statements:
select to_char('29.01.2018 00:00:00', 'DD.MM.YYYY HH24:MI:SS') from dual;
vs.
select to_char(sysdate, 'DD.MM.YYYY HH24:MI:SS') from dual;
I am asking why 1st select returns error: ORA-01722: invalid number
?
Why 1st select, in order to return the expected result needs to be written as: select to_char(to_date('29.01.2018 00:00:00', 'DD.MM.YYYY HH24:MI:SS')) from dual;
?
... and extrapolating from here I have another 2 situations related to 1st select:
- when it populates a VARCHAR2 field from a record it works just fine.
- when it populated a VARCHAR2 field from a table of records it returns above error message?
Thank you very much,