Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem: Change a reservationDate: Input the reservation ID and change reservation start and end date, if there is availability in the same room type for

Problem: Change a reservationDate: Input the reservation ID and change reservation start and end date, if there is availability in the same room type for the new date interval.

I have attached images of my procedural code, and the output for the procedure and execute statements. I have also attached my select statement and results. I can't seem to figure out what the error is in my code isn't updating the record in the table reservation itself.

I am coding PL/SQL in Oracle SQL Developer.

image text in transcribed

set serveroutput on CREATE OR REPLACE PROCEDURE change_reservation_date (reservation_id IN varchar2, reserv_start_date IN date, reserv_end date IN date, room type IN varchar2) IS CURSOR reserv cursor IS SELECT reserv_start, reserv end FROM reservation WHERE reservation.room number - room type: reserv_row reserv_cursor rowtype: BEGIN OPEN reserv cursor LOOP FETCH reserv cursor INTO reserv row: EXIT WHEN reserv cursortnotfound; END LOOP: UPDATE reservation SET reserv start reserv start date WHERE reservation. reservation id-reservation id and (reservation. reserv end reserv_end_date) UPDATE reservation SET reserv end-reserv end date WHERE reservation. reservation-id reservation-id and (reservation. reserv end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

Is the message courteous and positive in spirit?

Answered: 1 week ago

Question

=+5 How does HRM relate to efforts to increase innovation?

Answered: 1 week ago