SELECT
Place.placeID,
Place.compartmentID,
Place.name,
Place.type,
Place.startDate,
Place.startDateTime,
Place.endDate,
Place.endDateTime,
Place.recordStatus,
Place.versionNo
INTO
:placeID,
:compartmentID,
:name,
:type,
:startDate,
:startDateTime,
:endDate,
:endDateTime,
:recordStatus,
:versionNo
FROM
Place,
Reservation
WHERE
Place.compartmentID = :id
AND Place.recordStatus <> :recordStatus
AND Reservation.placeID = Place.placeID
AND Reservation.fromDate <= :dateTime
AND ( Reservation.toDate is NULL
OR Reservation.toDate >= :dateTime )
|