Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set serveroutput on;
- create or replace procedure AvgInvoiceDueCheck (rental_no in number) is
- declare
- high_invoice EXCEPTION;
- invoice rental_invoice.invoice_due%type;
- begin
- select avg(invoice_due) into invoice
- from rental_invoice
- where rental_no = invoice_due;
- if invoice_due >= 400 then
- raise high_invoice;
- else
- dbms_output.put_line('Average Invoice Due: ' || invoice);
- end if;
- exception
- when high_invoice then
- dbms_output.put_line('High invoice due');
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement