----------------------------------------------------------------
- PL/SQL: Trigger driver (Example 4.5.1)                       -
- Chapter 4; Oracle Programming -- A Primer                    -
-            by R. Sunderraman                                 -
----------------------------------------------------------------

DECLARE
  quantity_ordered_too_big EXCEPTION;
  PRAGMA EXCEPTION_INIT(quantity_ordered_too_big,-20001);
BEGIN
  process_orders.add_order(2000,1111,1000,null);
  insert into odetails values(2000,10900,70);
  DBMS_OUTPUT.PUT_LINE('Added row to odetails table');
  insert into odetails values(2000,10506,1500);
EXCEPTION
  WHEN quantity_ordered_too_big THEN
    DBMS_OUTPUT.PUT_LINE('Could not add part to order');
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
/
