Create a procedure named DDCKPAY_SP that confirms whether a monthly pledge payment is the correct amount. The procedure needs to accept two values as input: a payment amount and a pledge ID. Based on these inputs, the procedure should confirm that the payment is the correct monthly increment amount, based on pledge data in the database. If it isn’t, a custom Oracle error using error number 20050 and the message “Incorrect payment amount - planned payment = ??” should be raised. The ?? should be replaced by the correct payment amount. The database query in the procedure should be formulated so that no rows are returned if the pledge isn’t on a monthly payment plan or the pledge isn’t found. If the query returns no rows, the procedure should display the message “No payment information.” Test the procedure with the pledge ID 104 and the payment amount $25. Then test with the same pledge ID but the payment amount $20.Finally, test the procedure with a pledge ID for a pledge that doesn’t have monthly payments associated with it.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter12: Subqueries And Merge Statements
Section: Chapter Questions
Problem 19MC
icon
Related questions
icon
Concept explainers
Question
  1. Create a procedure named DDCKPAY_SP that confirms whether a monthly pledge payment is the correct amount. The procedure needs to accept two values as input: a payment amount and a pledge ID. Based on these inputs, the procedure should confirm that the payment is the correct monthly increment amount, based on pledge data in the database. If it isn’t, a custom Oracle error using error number 20050 and the message “Incorrect payment amount - planned payment = ??” should be raised. The ?? should be replaced by the correct payment amount. The database query in the procedure should be formulated so that no rows are returned if the pledge isn’t on a monthly payment plan or the pledge isn’t found. If the query returns no rows, the procedure should display the message “No payment information.” Test the procedure with the pledge ID 104 and the payment amount $25. Then test with the same pledge ID but the payment amount $20.Finally, test the procedure with a pledge ID for a pledge that doesn’t have monthly payments associated with it.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning