Posted By

wh0emPah on 04/02/10


Tagged


Versions (?)

azeraz


 / Published in: PL/SQL
 

  1. CREATE OR REPLACE TRIGGER P6_2_ORDERFILLED BEFORE
  2. INSERT OR UPDATE OF order_filled ON s_ord
  3. FOR EACH ROW
  4. v_ordlines NUMBER;
  5. SELECT COUNT(ord_id)
  6. INTO v_ordlines
  7. FROM s_item
  8. WHERE ord_id = :NEW.id;
  9. IF v_ordlines = 0 THEN
  10. RAISE_APPLICATION_ERROR(-20000, 'Order moet eerst orderlijnen bevatten!');
  11. END P6_2_ORDERFILLED;

Report this snippet  

You need to login to post a comment.