Hi,
The following code is supposed to stop a booking being made if falls between another bookings start and end date.
Unfortunately I get the following error message
PLS-00410: duplicate fields in RECORD,TABLE or argument list are not permitted
Any help would be greatly appreciated.
Thanks in advance
[code=oracle]
CREATE OR REPLACE PROCEDURE p_check_room_al loc_dates (
p_start_date LEASE.START_DAT E%TYPE,
p_end_date LEASE.END_DATE% TYPE,
p_room_id LEASE.ROOM_ID%T YPE,
p_lease_id LEASE.LEASE_ID% TYPE,
p_error OUT VARCHAR2
)
IS
p_error VARCHAR2 (200) := NULL;
v_dummy NUMBER;
BEGIN
IF p_start_date > p_end_date
THEN
p_error := 'End date cannot be earlier than start date';
END IF;
SELECT COUNT (*)
INTO v_dummy
FROM LEASE
WHERE ( ( p_start_date >= LEASE.START_DAT E
AND p_start_date <
NVL (LEASE.END_DATE , SYSDATE)
)
OR ( p_start_date <= LEASE.START_DAT E
AND p_end_date > LEASE.START_DAT E
)
)
AND LEASE.ROOM_ID = p_room_id
AND LEASE.LEASE_ID != p_lease_id;
IF v_dummy > 0
THEN
p_error := 'An Overlapping Room Booking Exists for these dates';
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_error :=
'System Error '
|| SUBSTR (TO_CHAR (SQLCODE) || ' ' || SQLERRM, 1, 100);
END;
[/code]
The following code is supposed to stop a booking being made if falls between another bookings start and end date.
Unfortunately I get the following error message
PLS-00410: duplicate fields in RECORD,TABLE or argument list are not permitted
Any help would be greatly appreciated.
Thanks in advance
[code=oracle]
CREATE OR REPLACE PROCEDURE p_check_room_al loc_dates (
p_start_date LEASE.START_DAT E%TYPE,
p_end_date LEASE.END_DATE% TYPE,
p_room_id LEASE.ROOM_ID%T YPE,
p_lease_id LEASE.LEASE_ID% TYPE,
p_error OUT VARCHAR2
)
IS
p_error VARCHAR2 (200) := NULL;
v_dummy NUMBER;
BEGIN
IF p_start_date > p_end_date
THEN
p_error := 'End date cannot be earlier than start date';
END IF;
SELECT COUNT (*)
INTO v_dummy
FROM LEASE
WHERE ( ( p_start_date >= LEASE.START_DAT E
AND p_start_date <
NVL (LEASE.END_DATE , SYSDATE)
)
OR ( p_start_date <= LEASE.START_DAT E
AND p_end_date > LEASE.START_DAT E
)
)
AND LEASE.ROOM_ID = p_room_id
AND LEASE.LEASE_ID != p_lease_id;
IF v_dummy > 0
THEN
p_error := 'An Overlapping Room Booking Exists for these dates';
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_error :=
'System Error '
|| SUBSTR (TO_CHAR (SQLCODE) || ' ' || SQLERRM, 1, 100);
END;
[/code]
Comment