SQL> -- Converting DATE to spelled-out character format.
SQL> DECLARE
2 myDate DATE := TO_DATE('06112067BC','MMDDYYYYBC');
3 myString VARCHAR2(100);
4 BEGIN
5 myString := TO_CHAR(myDate,'MMDDSYYYY');
6 DBMS_OUTPUT.PUT_LINE('The converted date is: ' || myString);
7 END;
8 /
The converted date is: 0611-2067
PL/SQL procedure successfully completed.
SQL>
|