title: my trigger wont print what i want it to
body: <p>so im a student working in Oracle SQL and i wrote a trigger to notify me if the item quantity is under a certain value. my trigger was created without compilation errors but when i test it i do not see the output that i want... I am sure there may be better ways to do certain parts of this but i am concerned mostly with how to get it to print to the command line. also if possible i would like the first if statement to contain a break statement so that the quantity cannot be less than 0. is that done by addint 'BREAK;' before the 'END IF;'?</p>
  
  <pre><code>SQL&gt; @345lowqtytrigger
  SQL&gt; CREATE OR REPLACE TRIGGER low_qty_trigger
    2  BEFORE INSERT OR UPDATE OF vnd_itm_qty ON Vending_Machine_Item
    3  FOR EACH ROW
    4  DECLARE
    5  tempstr varchar2(1000);
    6  name varchar2(1000);
    7  vndadd varchar2(1000);
    8  tempint int;
   9  cursor itm_des_cursor is
   10  SELECT itm_des FROM item WHERE itm_id = item.itm_id;
   11  cursor vnd_addr_cursor is
   12  SELECT vnd_addr FROM Vending_Machine WHERE vnd_id = Vending_Machine.vnd_id;
   13  BEGIN
   14          open itm_des_cursor;
   15          fetch itm_des_cursor into name;
   16          open vnd_addr_cursor;
   17          fetch vnd_addr_cursor into vndadd;
   18          IF :NEW.vnd_itm_qty &lt; 0 THEN
   19          tempstr := concat(:new.vnd_id,concat(' can not have less than 0 quantity for ',name));
   20          dbms_output.put_line(tempstr);
   21  end if;
   22  tempint := :new.vnd_itm_qty_max*.15;
   23          IF
   24          :NEW.vnd_itm_qty &lt;= tempint
   25          and
   26          :NEW.vnd_itm_qty &gt;= 0
   27          THEN
   28          tempstr := concat('There will be less than ',
   29  concat(to_char(tempint),
   30  concat(' of ',
   31  concat(name,
   32  concat(' in Vending Machine ',
   33  concat(to_char(:new.vnd_id),
   34  concat(' located at ',vndadd)))))));
   35  dbms_output.put_line(tempstr);
   36  END IF;
   37  close itm_des_cursor;
   38  close vnd_addr_cursor;
   39  END;
   40  /
  
  Trigger created.
  
  SQL&gt; SET ECHO OFF;
  No errors.
  SQL&gt; spool off;
  
  TEST CASE
  
  SQL&gt; update vending_machine_item set vnd_itm_qty = 1 where vnd_id = 956 and itm_id = 193;
  
  
  1 row updated.
  </code></pre>