Skip to main content
Question

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


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!

 

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+38
  • Influencer
  • August 9, 2018
david_r wrote:

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+18
  • Contributor
  • August 9, 2018

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

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings