update rr_facilities
set enabled_p = 'f'
where facility_id = :facility_id and
package_id = :package_id
update rr_facilities
set enabled_p = 't'
where facility_id = :facility_id and
package_id = :package_id
select name,
description
from rr_facilities
where facility_id = :facility_id and
package_id = :package_id
select facility_id
from rr_facilities
where UPPER(name) = UPPER(:name) and
package_id = :package_id
select name, facility_id
from rr_facilities_enabled
where package_id = :package_id
select name, facility_id
from rr_facilities_enabled f
where package_id = :package_id and
(select count(room_id)
from rr_rooms_enabled r
where r.facility_id = f.facility_id) > 0
select room_id
from rr_rooms
where facility_id = :facility_id