3

Is it possible to convert a Datetime value to string in PL SQL? I should to do that to a IF in PL SQL

CatDev
  • 43
  • 1
  • 5
  • Possible duplicate of [Oracle date to string conversion](https://stackoverflow.com/questions/13591546/oracle-date-to-string-conversion) – ihebiheb Oct 23 '19 at 15:50

2 Answers2

4

Use to_char(date, format)

e.g.

Select to_char(sysdate,'DD-MON-YYYY') from dual;

0

You can use like this:

SELECT  
TO_CHAR(TO_DATE('20190811 10:44:11','YYYYMMDD HH24:Mi:SS'),'YYYYMMDD HH24:Mi:SS') YOUR_STRING_DATE
 FROM
DUAL
CompEng
  • 7,161
  • 16
  • 68
  • 122