Thursday 7 January 2016

SELECT distinct srl.NAME, tsr.supplied_resource_id, per.full_name,
               tsr.vendor_id, ven.vendor_name, tsr.training_center_id,
               ota_general.get_org_name
                                 (tsr.training_center_id)
                                                         training_center_name,
               tsr.location_id,
               ota_general.get_location_code (tsr.location_id) LOCATION,
               tsr.resource_type, tsr.start_date, tsr.end_date, tsr.COST,
               tsr.currency_code, tsr.cost_unit, tsr.consumable_flag,
               tsr.special_instruction,        
               (SELECT decode(orb.status,'C','Not Allowed to Book','Available') FROM OTA_RESOURCE_BOOKINGS ORB
               where ORB.SUPPLIED_RESOURCE_ID=srl.SUPPLIED_RESOURCE_ID) status
          FROM ota_suppliable_resources tsr,
               ota_suppliable_resources_tl srl,
               per_all_people_f per,
               po_vendors ven            
         WHERE srl.supplied_resource_id = tsr.supplied_resource_id      
           AND srl.LANGUAGE = USERENV ('LANG')
           AND tsr.business_group_id = ota_general.get_business_group_id
           AND per.person_id(+) = tsr.trainer_id
           AND tsr.start_date BETWEEN per.effective_start_date(+) AND per.effective_end_date(+)
           AND ven.vendor_id(+) = tsr.vendor_id

_________________________________________________________________________
select ota_trb_api_procedures.function check_double_booking( ) essss from dual

No comments:

Post a Comment