Answered step by step
Verified Expert Solution
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.
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 endStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started