feat: experimental getLastBookings function
This commit is contained in:
parent
e982d2de87
commit
687f6e2ed7
|
@ -1,5 +1,4 @@
|
|||
|
||||
|
||||
CREATE OR REPLACE TYPE bookingIds AS TABLE OF NUMBER;
|
||||
|
||||
CREATE OR REPLACE FUNCTION mostValuableClerk(months IN NUMBER) RETURN NUMBER
|
||||
IS
|
||||
|
@ -30,15 +29,19 @@ BEGIN
|
|||
return finalclerkid;
|
||||
END;
|
||||
|
||||
CREATE OR REPLACE PROCEDURE getLastBookings(months IN NUMBER)
|
||||
CREATE OR REPLACE FUNCTION getLastBookings(months IN NUMBER) RETURN bookingIds
|
||||
IS
|
||||
CURSOR bookingsCursor IS SELECT BOOKINGID FROM BOOKING WHERE ARRIVALDATE >= ADD_MONTHS(SYSDATE,-months);
|
||||
|
||||
ids bookingIds;
|
||||
BEGIN
|
||||
ids := bookingIds();
|
||||
FOR booking IN bookingsCursor
|
||||
LOOP
|
||||
ids.extend;
|
||||
ids(ids.count) := booking.BOOKINGID;
|
||||
DBMS_OUTPUT.PUT_LINE(booking.BOOKINGID);
|
||||
END LOOP;
|
||||
return ids;
|
||||
END;
|
||||
|
||||
CREATE OR REPLACE PROCEDURE rooms(clientz IN NUMBER, months IN NUMBER)
|
||||
|
|
Loading…
Reference in a new issue