client-room procedure wip

This commit is contained in:
Jan Fröse 2023-05-12 17:25:09 +02:00
parent e0e6491d94
commit 7508f2f7cf

View file

@ -35,4 +35,20 @@ BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE(booking.BOOKINGID);
END LOOP;
END;
END;
create or replace procedure rooms(clientz in number, months in number)
is
startMonth date;
begin
startMonth := add_months(sysdate, months);
select br.ROOMNUMBER
from BOOKINGROOM br inner join (
select *
from BOOKING inner join CLIENT
on BOOKING.CLIENTID = CLIENT.PERSONID
where CLIENT.PERSONID = clientz and BOOKING.ARRIVALDATE >= startMonth
) bookings on br.BOOKINGID = bookings.BOOKINGID;
end rooms;