Task 2 Stored PL/SQL procedure Implement a stored PL/SQL procedure PARTSUPPLIER that lists information about the supplier key and supplier name supplying parts. The procedure first computes the total number of suppliers supplying the specified part. The procedure then extracts the supplier's information supplying the specified part. The information to be displayed include the part key, part name, the supplier key and the supplier's name. An example of a segment of the output for the list of suppliers supplying a specified part (part 59396) is as follow: part key: 59396, orange cream sandy lavender drab Number of suppliers supplying the part: 4 supplier Key 166 Supplier#000000166 935 Supplier#000000935 1704 Supplier#000001704 2397 Supplier#000002397 supplier Name It is up to you to decide if you want to handle exception in your procedure. Deliverables Submit your spooled file solution2.Ist (or solution2.pdf) that contains your SQL script and the output from the execution of the script. The report must have no errors related to the implementation of your task and it must list all PL/SQL and SQL statements processed. Remember to set ECHO option of SQL*Plus to ON!

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter6: Additional Database Objects
Section: Chapter Questions
Problem 1HOA
icon
Related questions
icon
Concept explainers
Question
Task 2
Stored PL/SQL procedure
Implement a stored PL/SQL procedure PARTSUPPLIER that lists information
about the supplier key and supplier name supplying parts. The procedure first
computes the total number of suppliers supplying the specified part. The
procedure then extracts the supplier's information supplying the specified part.
The information to be displayed include the part key, part name, the supplier
key and the supplier's name. An example of a segment of the output for the
list of suppliers supplying a specified part (part 59396) is as follow:
part key: 59396, orange cream sandy lavender drab
Number of suppliers supplying the part: 4
supplier Key
166 Supplier#000000166
935 Supplier#000000935
1704 Supplier#000001704
2397 Supplier#000002397
supplier Name
It is up to you to decide if you want to handle exception in your procedure.
Deliverables
Submit your spooled file solution2.lst (or solution2.pdf) that contains your SQL script
and the output from the execution of the script. The report must have no errors
related to the implementation of your task and it must list all PL/SQL and SQL
statements processed.
Remember to set ECHO option of SQL*Plus to ON!
Transcribed Image Text:Task 2 Stored PL/SQL procedure Implement a stored PL/SQL procedure PARTSUPPLIER that lists information about the supplier key and supplier name supplying parts. The procedure first computes the total number of suppliers supplying the specified part. The procedure then extracts the supplier's information supplying the specified part. The information to be displayed include the part key, part name, the supplier key and the supplier's name. An example of a segment of the output for the list of suppliers supplying a specified part (part 59396) is as follow: part key: 59396, orange cream sandy lavender drab Number of suppliers supplying the part: 4 supplier Key 166 Supplier#000000166 935 Supplier#000000935 1704 Supplier#000001704 2397 Supplier#000002397 supplier Name It is up to you to decide if you want to handle exception in your procedure. Deliverables Submit your spooled file solution2.lst (or solution2.pdf) that contains your SQL script and the output from the execution of the script. The report must have no errors related to the implementation of your task and it must list all PL/SQL and SQL statements processed. Remember to set ECHO option of SQL*Plus to ON!
Task 3
Stored trigger
Implement a row trigger that enforces the following consistency constraint.
The column c_comment in the relational table CUSTOMER of the TPCHR
benchmark database is defined as 'NOT NULL'. Create a row trigger that
automatically updates the values in the column (c_comment) to 'New customer
was created on <the system date>' if the comment of the newly inserted record
is left as NULL when a new customer is inserted into the relational table
CUSTOMER. Your trigger, once activated, will enforce the consistency constraint
described.
When ready, process the SQL script solution2.sql and record the results of
processing in a file solution2.Ist.
Deliverables
Hand in the SQL script and the report from execution of scripts.
Remember to set ECHO option of SQL*Plus to ON!
Transcribed Image Text:Task 3 Stored trigger Implement a row trigger that enforces the following consistency constraint. The column c_comment in the relational table CUSTOMER of the TPCHR benchmark database is defined as 'NOT NULL'. Create a row trigger that automatically updates the values in the column (c_comment) to 'New customer was created on <the system date>' if the comment of the newly inserted record is left as NULL when a new customer is inserted into the relational table CUSTOMER. Your trigger, once activated, will enforce the consistency constraint described. When ready, process the SQL script solution2.sql and record the results of processing in a file solution2.Ist. Deliverables Hand in the SQL script and the report from execution of scripts. Remember to set ECHO option of SQL*Plus to ON!
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning