I currently do not know ANSI equivalent to Teradata FORMAT key word for converting timestamp, date data types into our required representation formats. I know this can be done with to_char, to_date like individual database specific functions, But I want to write in ANSI so that in future I can easily move code running from one DB to another. Below is the current Teradata SQL I am trying to convert into ANSI so that I can run it on both Teradata ,Netezza and Vertica etc.
SELECT
CAST( (MYTIME ( FORMAT 'DDMMYYYY')) AS CHAR( 8 ))
|| CAST( (MYTIME (FORMAT 'HHMISS')) AS CHAR(6))
|| CAST(CAST(MYNUMBER AS FORMAT'-9(5)') AS CHAR(5))
FROM MYTABLE
;
Currently I don't know how to translate the FORMAT 'HHMISS', FORMAT '-9(5)' into ANSI. Is there any documentation on this possible ANSI equivalent functions if any? Please help.