1

I have SCN:

SELECT TIMESTAMP_TO_SCN(SYSTIMESTAMP) SCN FROM DUAL;

I can convert it to time stamp:

SELECT SCN_TO_TIMESTAMP(6480157) FROM DUAL;

When I want to mix this two select Im getting error:

SELECT SCN_TO_TIMESTAMP(SELECT TIMESTAMP_TO_SCN(SYSTIMESTAMP) FROM DUAL) FROM DUAL;

ORA-00936: missing expression

4est
  • 3,010
  • 6
  • 41
  • 63

2 Answers2

4

Please use

SELECT SCN_TO_TIMESTAMP(TIMESTAMP_TO_SCN(SYSTIMESTAMP)) FROM DUAL;
F.Madsen
  • 702
  • 4
  • 6
2

@F.Madsen has the correct and simplest answer, but just to illustrate, you can get to the result following your logic:

SELECT SCN_TO_TIMESTAMP(SCN) FROM
(
  SELECT (TIMESTAMP_TO_SCN(SYSTIMESTAMP)) SCN FROM DUAL
);
Based
  • 950
  • 7
  • 18