LOCALTIMESTAMP, SYSTIMESTAMP and TO_TIMESTAMP
Hello,
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions079.htm
The above link to the Oracle manual gives, regarding localtimestamp, the following working example:
INSERT INTO local_test VALUES
(TO_TIMESTAMP(LOCALTIMESTAMP, 'DD-MON-RR HH.MI.SSXFF PM'));
I have some questions regarding the conversion to TIMESTAMP.
1) Why convert a TIMESTAMP value (the return type of LOCALTIMESTAMP is TIMESTAMP) to TIMESTAMP?
2) Why is the function TO_TIMESTAMP works when we supply as the first argument the LOCALTIMESTAMP? According to the manual, the function TO_TIMESTAMP converts to TIMESTAMP arguments of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 datatype.
3) If the answer of the question above (2) is because of an implicit conversion to VARCHAR2, then why SYSTIMESTAMP fails? For example the following does not work:
INSERT INTO local_test VALUES
(TO_TIMESTAMP(SYSTIMESTAMP, 'DD-MON-RR HH.MI.SSXFF PM TZH:TZM'));
Thank you in advance,
Apostolos Giannakidis