Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. set serveroutput on;
  2. create or replace procedure AvgInvoiceDueCheck (rental_no in number) is
  3. declare
  4. high_invoice EXCEPTION;
  5. invoice rental_invoice.invoice_due%type;
  6. begin
  7. select avg(invoice_due) into invoice
  8. from rental_invoice
  9. where rental_no = invoice_due;
  10. if invoice_due >= 400 then
  11. raise high_invoice;
  12. else
  13. dbms_output.put_line('Average Invoice Due: ' || invoice);
  14. end if;
  15. exception
  16. when high_invoice then
  17. dbms_output.put_line('High invoice due');
  18. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement