Create a stored procedure named sp_ListBookDetails()
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 stored procedure named sp_ListBookDetails().
CREATE OR REPLACE PROCEDURE sp_ListBookDetails(in_ISBN IN INTEGER)
AS
temp_BookTitle VARCHAR2(250);
temp_BookDescription VARCHAR(250);
temp_BookPrice NUMBER(12,2);
temp_BookReviews INTEGER;
temp_UserRating NUMBER(12,2);
temp_BookCategoryID INTEGER;
BEGIN
SELECT
Book_Title
,Book_Description
,Book_Price
,Book_Reviews
,User_Rating
,Book_Category_ID
INTO
temp_BookTitle
,temp_BookDescription
,temp_BookPrice
,temp_BookReviews
,temp_UserRating
,temp_BookCategoryID
FROM HOL_BOOKS
WHERE ISBN = in_ISBN;
-- Output the results
DBMS_Output.Put_Line('---------------------------------------------');
DBMS_Output.Put_Line('Here are the details for ISBN ' || in_ISBN);
DBMS_Output.Put_Line('');
DBMS_Output.Put_Line('Book Title: ' || temp_BookTitle);
DBMS_Output.Put_Line('Book Description: ' || temp_BookDescription);
DBMS_Output.Put_Line('Book Price: ' || temp_BookPrice);
DBMS_Output.Put_Line('Book Reviews: ' || temp_BookReviews);
DBMS_Output.Put_Line('Book User Rating: ' || temp_UserRating);
DBMS_Output.Put_Line('Book Category Code: ' || temp_BookCategoryID);
DBMS_Output.Put_Line('---------------------------------------------');
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_Output.Put_Line('Cannot find this ISBN in HOL_BOOKS: ' || in_ISBN);
END
begin
sp_ListBookDetails(1);
sp_ListBookDetails(23734);
end
begin
sp_ListBookDetails();
end
![H
HOL_REGIONS
PK Region ID
HOL_JOBS
PK Job ID
HOL_CUSTOMERS
PK Customer ID
KFK Location_ID
开
H+
++
To HOL_LOCATIONS
DBMS 130: HOL Small Company ERD
HOL_COUNTRIES
PK Country_ID
FK Region_ID
HOL_JOB_HISTORY
PK Job History_ID
FK Employee_ID
FK Job_ID
FK Department_ID
HOL_ORDERS
PK Order Number
FK Customer_ID
H+
++
HOL_LOCATIONS
PK Location ID
FK Country_ID
HOL_EMPLOYEES
HPK Employee_ID
FK Department_ID
FK Job_ID
HOL_ORDER_ITEMS
PK Order Item ID
FK ISBN
KFK Order_Number
H
+ PK
HOL_DEPARTMENTS
HPK Department_ID
FK Location_ID
HOL_BOOKS
ISBN
FK Book_Category_ID
+H
HOL_BOOK_CATEGORY
KPK Book_Category_ID](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff5687225-f4ce-4b08-8a49-c9e8248dc732%2F29d6a235-899b-48c4-b216-5a0e905adb2f%2Fljf6hif_processed.jpeg&w=3840&q=75)
![PK
PK
PK
FK
FK Region_ID
PK
FK
FK
PK
U
FK
PK
FK
FK
Legend
Tables provided
Tables you complete
Region_ID
Region_Name
FK
FK
Country_Code
Country_Name
Location ID
Street
City
State_Province
Postal Code
Country_ID
Department_ID
Department_Name
Manager_ID
Location_ID
Customer_ID
First Name
Middle Name
Last_Name
Email
Phone
Birth_Date
Gender
Location_ID
Order Number
Order Date
Order Total
Customer_ID
Sales_Person_ID
PK Order Item ID
Unit Price
Quantity
Order Number
ISBN
HOL_REGIONS
INTEGER
VARCHAR2(250)
HOL_COUNTRIES
CHAR(2)
VARCHAR2(250)
INTEGER
HOL_LOCATIONS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
CHAR(2)
VARCHAR2(50)
INTEGER
HOL_DEPARTMENTS
INTEGER
VARCHAR2(250)
INTEGER
INTEGER
HOL_CUSTOMERS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(50)
DATE
VARCHAR2(50)
INTEGER
HOL_ORDERS
INTEGER
DATE
NUMBER(18,2)
INTEGER
INTEGER
HOL_ORDER_ITEMS
INTEGER
NUMBER(12,2)
INTEGER
INTEGER
INTEGER
PK
FK
NN
U
PK
NN
NN
FK
FK
FK
PRIMARY KEY
FOREIGN KEY
NOT NULL
UNIQUE
Employee_ID
First Name
Middle Name
Last Name
Email
Phone
PK
NN
Hire Date
Current_Salary
Commision_Pct
FK
Bonus
Job_ID
PK Job ID
NN Job Title
Manager_ID
Department ID
PK Job_History_ID
FK
Employee_ID
Start Date
End Date
Job ID
Max_Salary
Min_Salary
FK
FK Department_ID
ISBN
Book Title
Book_Description
Book Price
Book Reviews
User_Rating
Book_Category_ID
HOL_EMPLOYEES
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(50)
DATE
NUMBER(12,2)
NUMBER(2,2)
NUMBER(12,2)
INTEGER
INTEGER
INTEGER
HOL_JOBS
INTEGER
VARCHAR2(250)
NUMBER(12,2)
NUMBER(12,2)
HOL_JOB_HISTORY
IDENTITY
INTEGER
DATE
DATE
INTEGER
INTEGER
HOL_BOOKS
INTEGER
VARCHAR2(250)
VARCHAR2(4000)
NUMBER(12,2)
INTEGER
NUMBER(4,2)
INTEGER
HOL_BOOK_CATEGORY
PK Book_Category_ID
NN Book_Category_Name
VARCHAR2(250)
Book_Category_Description VARCHAR2(4000)
INTEGER](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff5687225-f4ce-4b08-8a49-c9e8248dc732%2F29d6a235-899b-48c4-b216-5a0e905adb2f%2F4radcs_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)