--------------------------------------------------------
--  DDL for View WEBSERVICESEXECUTION_RABI_SUMMARIZED_VW
--------------------------------------------------------

  CREATE OR REPLACE FORCE EDITIONABLE VIEW "OTHQ_OWN"."WEBSERVICESEXECUTION_RABI_SUMMARIZED_VW" ("STYPE", "UNIQUE_COUNT_SCOMPID", "REQUESTS", "PERIOD", "METADATA_SOURCE") DEFAULT COLLATION "USING_NLS_COMP"  AS 
  SELECT 
    "STYPE",
    "UNIQUE_COUNT_SCOMPID",
    "REQUESTS",
    "PERIOD",
    'CSV' AS METADATA_SOURCE
FROM
    ARCHIVE_CSV_WEBSERVICESEXECUTION_RABI_SUMMARIZED_TB

UNION ALL

SELECT 
    "STYPE",
    "UNIQUE_COUNT_SCOMPID",
    "REQUESTS",
    "PERIOD",
    'OSEARCH' AS METADATA_SOURCE
FROM
    ARCHIVE_OSEARCH_WEBSERVICESEXECUTION_RABI_SUMMARIZED_TB o
WHERE
    NOT EXISTS (
        SELECT 1
        FROM ARCHIVE_CSV_WEBSERVICESEXECUTION_RABI_SUMMARIZED_TB c
        WHERE c."STYPE" = o."STYPE"
          AND c."PERIOD" = o."PERIOD"
    )
ORDER BY "PERIOD", "STYPE"
;
