--
--001
--
SELECT
  wact_id,
  wact_starttime,
  wact_endtime,
  wact_description,
  wact_hc_extrainfo,
  waty_longdesc,
  want_notes,
  wact_compltime,
  WACT_COMPLPERC,
  WACT_STATUS,
  wact_xcom_id,
  xcmt_longdesc,
  xcom_value,
  YBOM_ID,
  YBOM_NAME,
  YBOM_ARRIVAL,
  YBOM_DEPARTURE,
  YBOM_RMS_YEST_ID,
  YBOM_CON_YEST_ID,
  YBOM_NOOFATTENDEES,
  decode(WACT_COMPLPERC,'100','Completed','') Completed,
  decode(decode(YBOM_RMS_YEST_ID,'','','Rooms') || (decode(decode(YBOM_CON_YEST_ID,'','','Conference'),'',' only',' and Conference')),' and Conference','Conference only',decode(YBOM_RMS_YEST_ID,'','','Rooms') || (decode(decode(YBOM_CON_YEST_ID,'','','Conference'),'',' only',' and Conference')))  Booking,
  room.YEST_LONGDESC roomstatus ,conf.YEST_LONGDESC  confstatus
FROM
  wact,
  waty,
  want,
  ybom,
  yest room,
  yest conf,
  xcmt,
  xcom
WHERE
  wact_id=:parameter
  and  wact_waty_id=waty_id(+)
  and  wact_want_id=want_id(+)
  and  wact_ybom_id=ybom_id(+)
  and  YBOM_RMS_YEST_ID=room.YEST_ID(+)
  and  YBOM_CON_YEST_ID=conf.YEST_ID(+)
  and wact_xcom_id=xcom_id(+)
  and xcom_xcmt_id = xcmt_id(+);
--
--002
--

SELECT
  xcms_name1,
  xcms_name2,
  xcms_name3,
  xcms_id
FROM
  wala,
  xcms
WHERE
  wala_xcms_id=xcms_id      and
  wala_wact_id=:parameter      and
  xcms_type= 1;

--
--003
--

SELECT
  xcms_name1,
  xcms_name2,
  xcms_name3,
  (decode(XCID_ADDRGREET,'','',XCID_ADDRGREET||' ') ||
   decode(XCMS_NAME3,'','',XCMS_NAME3||' ')||
   decode(XCMS_NAME2,'''','''',XCMS_NAME2||' ')||
   decode(XCMS_NAME1,'','',XCMS_NAME1||' ')
  ) XName,
  xcms_id
FROM
  wala,xcms,xcid
WHERE
  wala_xcms_id=xcms_id      and
  wala_wact_id=:parameter      and
  wala_xcms_id=xcid_id(+) and 
  xcms_type= 2;

--
--004
--

SELECT
  xcms_name1,
  xcms_name2,
  xcms_name3,
  ltrim(xcms_name1)||',
  '||ltrim(xcms_name3) as XName,
  xcms_id
FROM
  wala,
  xcms
WHERE
  wala_xcms_id=xcms_id      and
  wala_wact_id=:parameter      and
  xcms_type= 3;
