client-room procedure wip
This commit is contained in:
parent
e0e6491d94
commit
7508f2f7cf
1 changed files with 17 additions and 1 deletions
|
@ -36,3 +36,19 @@ BEGIN
|
|||
DBMS_OUTPUT.PUT_LINE(booking.BOOKINGID);
|
||||
END LOOP;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue