Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why is this flashback query not working? Timestamp syntax error?

toonieFeb 7 2015 — edited Feb 9 2015

Please see below - can someone please advise where I am going wrong here??

-- This is my sample data

SQL> select * from ports;

   PORT_ID PORT_NAME

---------- ------------------------------

         1 Baltimore

         2 Charleston

         3 Tampa

         4 Miami

-- Timestamps appear to work as expected

SQL> select systimestamp from dual;

SYSTIMESTAMP

---------------------------------------------------------------------------

01-DEC-14 01.13.44.116865 PM +00:00

SQL> select (SYSTIMESTAMP - INTERVAL '60' MINUTE) from dual;

(SYSTIMESTAMP-INTERVAL'60'MINUTE)

---------------------------------------------------------------------------

01-DEC-14 12.14.05.124067000 PM +00:00

So i delete a row and....

-- If I attempt to build the timestamp into a flashback query?

SQL> select port_id, port_name from ports AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '5' MINUTE);

select port_id, port_name from ports AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '5' MINUTE)

                               *

ERROR at line 1:

ORA-08186: invalid timestamp specified

SQL> select * from ports as of timestamp(sysdate - 5/1440);

select * from ports as of timestamp(sysdate - 5/1440)

              *

ERROR at line 1:

ORA-08186: invalid timestamp specified

What is the cause of the error here? Is the timestamp format not correct?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2015
Added on Feb 7 2015
16 comments
3,517 views