DBA Data[Home] [Help]

VIEW: APPS.WIP_CUMULATIVE_SCRAP_V

Source

View Text - Preformatted

SELECT rowid row_id, wip_entity_id, cumulative_scrap_quantity, sum(quantity_scrapped) over (partition by wip_entity_id, organization_id, nvl(repetitive_schedule_id, -9999) order by operation_seq_num rows between unbounded preceding and 1 preceding) sum_of_qty_scrapped from wip_operations wo where wo.cumulative_scrap_quantity is null and EXISTS (select 1 from wip_discrete_jobs wdj where wdj.status_type not in (12,5,7) and wdj.wip_entity_id = wo.wip_entity_id UNION ALL select 1 from wip_repetitive_schedules wrs where wrs.status_type not in (12,5,7) and wrs.wip_entity_id = wo.wip_entity_id )
View Text - HTML Formatted

SELECT ROWID ROW_ID
, WIP_ENTITY_ID
, CUMULATIVE_SCRAP_QUANTITY
, SUM(QUANTITY_SCRAPPED) OVER (PARTITION BY WIP_ENTITY_ID
, ORGANIZATION_ID
, NVL(REPETITIVE_SCHEDULE_ID
, -9999) ORDER BY OPERATION_SEQ_NUM ROWS BETWEEN UNBOUNDED PRECEDING
AND 1 PRECEDING) SUM_OF_QTY_SCRAPPED
FROM WIP_OPERATIONS WO
WHERE WO.CUMULATIVE_SCRAP_QUANTITY IS NULL
AND EXISTS (SELECT 1
FROM WIP_DISCRETE_JOBS WDJ
WHERE WDJ.STATUS_TYPE NOT IN (12
, 5
, 7)
AND WDJ.WIP_ENTITY_ID = WO.WIP_ENTITY_ID UNION ALL SELECT 1
FROM WIP_REPETITIVE_SCHEDULES WRS
WHERE WRS.STATUS_TYPE NOT IN (12
, 5
, 7)
AND WRS.WIP_ENTITY_ID = WO.WIP_ENTITY_ID )