Skip to main content
Question

Oracle reader: read only records between now and a timestime 7 days ago.

  • August 9, 2018
  • 3 replies
  • 26 views

Forum|alt.badge.img

Hi,

So I have an oracle database with oracle timestamps as one of the columns. How can I make it so the reader only reads records between today and 7 days ago based on that timestamp? Otherwise I'll be reading millions of useless records

Thanks so much!

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • August 9, 2018

You can use a where-clause on the reader, e.g.

mytimestamp > sysdate-7

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • August 9, 2018

You can use a where-clause on the reader, e.g.

mytimestamp > sysdate-7
mytimestamp > trunc(sysdate - 7)
This is better if wanting the past 7 days rather than 168 hours ago

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • August 9, 2018

Or trunc(sysdate) - trunc(mytimestamp) < 8

In cases you use 7 you probably want the <= (less or equal).