diff --git a/SQL/PLSQL.sql b/SQL/PLSQL.sql index eba2ef9..cdfe014 100644 --- a/SQL/PLSQL.sql +++ b/SQL/PLSQL.sql @@ -30,9 +30,9 @@ BEGIN return finalclerkid; END; -CREATE OR REPLACE PROCEDURE getLastBookings(months IN NUMBER) +CREATE OR REPLACE PROCEDURE getLastBookings(months IN NUMBER, clientz in NUMBER) IS - CURSOR bookingsCursor IS SELECT BOOKINGID FROM BOOKING WHERE ARRIVALDATE >= ADD_MONTHS(SYSDATE,-months); + CURSOR bookingsCursor IS SELECT BOOKINGID FROM BOOKING WHERE ARRIVALDATE >= ADD_MONTHS(SYSDATE,-months) AND clientId = clientz; BEGIN FOR booking IN bookingsCursor