Question: Write an PL/SQL anonymous block program unit that display the number of invoices in invoices table for a specific state which is input by the
Write an PL/SQL anonymous block program unit that display the number of invoices in invoices table for a specific state which is input by the user (bind variable). The number of invoices should be only for those invoices that are due ( payment_date= null) and its invoice total exceeds $500 (like >$500). The printed message should be like " # invoices in the state of % are due and exceed $500 dollars" where # is 'count value' and the % is the user-input state. You will define an exception called 'ZERO_COUNT'. The program raises the exception"ZERO_COUNT" if the count of invoices retrieved =0. and print the message "No invoices that are due and exceeds $500 were found for the state of %" where % is to be replaced with the user-input state. Hint: - Use implicit cursor only. - Do not use "no_data_found" exception. It will not be triggered if you used it - Declare only one variable to hold the count and one exception called "ZERO_COUNT"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
