title: How to read value inside a Database View?
body: <p>I have the below view.</p>
  <pre><code>CREATE OR REPLACE VIEW vw_myview AS
  SELECT
  emp_joining_dt,
  emp_joining_dt+365 as emp_reminder_dt
  FROM EMP
  /
  </code></pre>
  <p>After 1 year of employee's joining, a reminder need to be sent. Daily job reads <code>emp_reminder_dt</code> and triggers it.</p>
  <p>365 days is mostly constant. But, the requirement is that the company might wish to change it to 183 or 730.</p>
  <p>So, the value 365 is configured in a table and read from DB.</p>
  <pre><code>CREATE OR REPLACE VIEW vw_myview AS
  SELECT
  emp_joining_dt,
  emp_joining_dt+MyPackage.get_reminder_days as emp_reminder_dt
  FROM EMP
  /
  </code></pre>
  <p>The problem with above approach is that everytime the view is queried it makes a call to database
  to read the value from the configuration table.</p>
  <p>Concern has been raised that frequent query to Database should be avoided.</p>
  <p>Is there a way to read the value 365 1st time from DB and then on from some cache.
  Then when the value is changed, read 1st time from DB and then on from some cache?</p>
  <p>Using cache was just my guess but is there any other way?</p>