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.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
- 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.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps