title: pl/sql procedure that check 1 month from sysdate
body: <p>I need a procedure that will check is the date_of_sell is more that 30 days from sysdate, then in_stock will change to "not in stock" and online_stock will change to "1"</p>
  
  <pre><code>create table items (
      item_no number not null,
      item_name varchar2(30) not null,
      description_item varchar2(100) null,
      date_of_sell date,
      in_stock varchar2(20) not null,
      online_stock number(1) default 0 not null,
      check (in_stock in ('In stock', 'not in stock', 'closed'));
  </code></pre>
  
  <pre><code>create or replace procedure update_stock (item_no in number)
  
  
      as
      begin
  update items 
      set in_stock = 'not in stock',  online_stock = 1    
      where date_of_sell &lt;= DATEADD(day, -30, GETDATE());
  end update_stock;
  /
  </code></pre>