EXP_GAE_PROD_MONTHLY


[Columns] [Composed Of] [Referenced By] [Refers To]

General Information

[Next]
Name EXP_GAE_PROD_MONTHLY
Entity Type ObjectView
Description Custom Exporters - EXP_GAE_PROD_MONTHLY
Submodel Data_Object
Entity Scope Project
Primary Key Id
Natural Key
Generalizations
Specializations


Columns

[Previous] [Next] [Top]
NameValue DomainProperty /
Storage Unit
DescriptionRequired /
Default
Type
ALIAS_NAME STRING255 NA
_ No
VARCHAR2(255)
BOREHOLE_ID NUMBER NA
_ No
NUMBER
DAYS NUMBER NA
_ No
NUMBER
FLOW_DIRECTION_CODE STRING64 NA
_ No
VARCHAR2(64)
GAS_VOLUME NUMBER NA
_ No
NUMBER
Id ID No_Unit
Unique identifier Yes
NUMBER(38)
MATERIAL_DISPOSITION_CODE STRING64 NA
_ No
VARCHAR2(64)
NAME STRING255 NA
_ No
VARCHAR2(255)
OIL_VOLUME NUMBER NA
_ No
NUMBER
PRODUCTION_DATE DATE NA
_ No
DATE
PRODUCTION_ENTITY_ID NUMBER NA
_ No
NUMBER
PRODUCTION_PARAMETER STRING64 NA
_ No
VARCHAR2(64)
PRODUCTION_TYPE STRING64 NA
_ No
VARCHAR2(64)
RESERVOIR_NAME STRING255 NA
_ No
VARCHAR2(255)
STRING_TYPE STRING255 NA
_ No
VARCHAR2(255)
TUBING_STRING_ID NUMBER NA
_ No
NUMBER
UWI STRING64 NA
_ No
VARCHAR2(64)
WATER_VOLUME NUMBER NA
_ No
NUMBER
WELL_ID NUMBER NA
_ No
NUMBER


View Definition

[Previous] [Top]

CREATE OR REPLACE FORCE VIEW exp_gae_prod_monthly(ID, WELL_ID, NAME, ALIAS_NAME, UWI, RESERVOIR_NAME, STRING_TYPE, PRODUCTION_TYPE, PRODUCTION_PARAMETER, PRODUCTION_DATE, OIL_VOLUME, WATER_VOLUME, GAS_VOLUME, DAYS, FLOW_DIRECTION_CODE, MATERIAL_DISPOSITION_CODE, BOREHOLE_ID, TUBING_STRING_ID, PRODUCTION_ENTITY_ID) AS SELECT NVL (PV_OIL.ID, NVL (PV_gas.ID, PV_water.ID)) Id,
          w.id well_id,
          w.uwi || ':' || ts.string_type Name,
          BA.ALIAS_NAME || ':' || ts.string_type ALIAS_NAME,
          w.uwi UWI,
          NVL2 (r.name, r.name, 'Undefined') Reservoir_Name,
          ts.name String_Type,
          ph.volume_method_code production_type,
          ph.Reporting_Period_Code PRODUCTION_PARAMETER,
          ph.start_date Production_Date,
          NVL (pv_oil.volume, 0) Oil_Volume,
          NVL (pv_water.volume, 0) Water_Volume,
          NVL (pv_gas.volume, 0) Gas_Volume,
          NVL (
             PV_OIL.PRODUCTIVE_DURATION,
             NVL 
(PV_gas.PRODUCTIVE_DURATION, PV_water.PRODUCTIVE_DURATION))
             Days,
          NVL (
             PV_OIL.FLOW_DIRECTION_CODE,
             NVL (PV_gas.FLOW_DIRECTION_CODE, PV_water.FLOW_DIRECTION_CODE))
             FLOW_DIRECTION_CODE,
          NVL (
             PV_OIL.MATERIAL_DISPOSITION_CODE,
             NVL (PV_gas.MATERIAL_DISPOSITION_CODE,
                  PV_water.MATERIAL_DISPOSITION_CODE))
             MATERIAL_DISPOSITION_CODE,
          bh.Id Borehole_Id,
          ts.Id Tubing_String_Id,
          pe.id Production_Entity_Id
     FROM production_header ph,
          borehole bh,
          Borehole_Alias ba,
          well w,
          well_completion wc,
          tubing_string ts,
          production_entity pe,
          production_volume pv_oil,
          production_volume pv_water,
          production_volume pv_gas,
          Well_Completion_Reservoir wcr,
          Reservoir r
    WHERE     bh.id = wc.borehole_id
          AND bh.well_id = w.id
         
 AND BH.UBHI = W.UWI
          AND BA.BOREHOLE_ID(+) = BH.ID
          AND BA.ALIAS_TYPE(+) = 'SIMULATION'
          AND wc.tubing_string_id = ts.id(+)
          AND wc.id = PE.WELL_COMPLETION_ID
          AND pe.id = ph.production_entity_id
          AND pe.Production_Entity_Subtype = 'Well_Completion'
          AND ph.id = pv_oil.production_header_id(+)
          AND INITCAP (pv_oil.material_type(+)) = 'Oil'
          AND ph.id = pv_water.production_header_id(+)
          AND INITCAP (pv_water.material_type(+)) = 'Water'
          AND ph.id = pv_gas.production_header_id(+)
          AND INITCAP (pv_gas.material_type(+)) = 'Gas'
          AND PV_GAS.MATERIAL_DISPOSITION_CODE(+) = 'NATURAL'
          AND PV_OIL.MATERIAL_DISPOSITION_CODE(+) = 'NATURAL'
          AND PV_WATER.MATERIAL_DISPOSITION_CODE(+) = 'NATURAL'
          --AND PV_GAS.FLOW_DIRECTION_CODE = 'PRODUCTION'
       --   AND PV_GAS.FLOW_DIRECTION_CODE = 'PRODUCTION'
       --   AND PV_GAS.FLOW_DIRECTION_CODE = 
'PRODUCTION'
          AND wc.Id = wcr.Well_Completion_Id(+)
          AND r.Id(+) = wcr.Reservoir_Id
          AND NVL (PV_OIL.ID, NVL (PV_gas.ID, PV_water.ID)) is not null
          --AND ph.Reporting_Period_Code  in ('Monthly')
          AND ph.Reporting_Period_Code  in ('Monthly')
   UNION
   SELECT NVL (PV_OIL.ID, NVL (PV_gas.ID, PV_water.ID)) Id,
          w.id well_id,
          w.uwi || ':' || ts.string_type Name,
          BA.ALIAS_NAME || ':' || ts.string_type ALIAS_NAME,
          w.uwi UWI,
          NVL2 (r.name, r.name, 'Undefined') Reservoir_Name,
          ts.name String_Type,
          ph.volume_method_code production_type,
          ph.Reporting_Period_Code PRODUCTION_PARAMETER,
          ph.start_date Production_Date,
          NVL (pv_oil.volume, 0) Oil_Volume,
          NVL (pv_water.volume, 0) Water_Volume,
          NVL (pv_gas.volume, 0) Gas_Volume,
          NVL (
             PV_OIL.PRODUCTIVE_DURATION,
             NVL (PV_gas.PRODUCTIVE_DURATION, 
PV_water.PRODUCTIVE_DURATION))
             Days,
          NVL (
             PV_OIL.FLOW_DIRECTION_CODE,
             NVL (PV_gas.FLOW_DIRECTION_CODE, PV_water.FLOW_DIRECTION_CODE))
             FLOW_DIRECTION_CODE,
          NVL (
             PV_OIL.MATERIAL_DISPOSITION_CODE,
             NVL (PV_gas.MATERIAL_DISPOSITION_CODE,
                  PV_water.MATERIAL_DISPOSITION_CODE))
             MATERIAL_DISPOSITION_CODE,
          bh.Id Borehole_Id,
          ts.Id Tubing_String_Id,
          pe.id Production_Entity_Id
     FROM production_header ph,
          borehole bh,
          Borehole_Alias ba,
          well w,
          well_completion wc,
          tubing_string ts,
          production_entity pe,
          production_volume pv_oil,
          production_volume pv_water,
          production_volume pv_gas,
          Well_Completion_Reservoir wcr,
          Reservoir r
    WHERE     bh.id = wc.borehole_id
          AND bh.well_id = w.id
          AND BH.UBHI = W.UWI
        
  AND BA.BOREHOLE_ID(+) = BH.ID
          AND BA.ALIAS_TYPE(+) = 'SIMULATION'
          AND wc.tubing_string_id = ts.id(+)
          AND wc.id = PE.WELL_COMPLETION_ID
          AND pe.id = ph.production_entity_id
          AND pe.Production_Entity_Subtype = 'Well_Completion'
          AND ph.id = pv_oil.production_header_id(+)
          AND INITCAP (pv_oil.material_type(+)) = 'Oil'
          AND ph.id = pv_water.production_header_id(+)
          AND INITCAP (pv_water.material_type(+)) = 'Water'
          AND ph.id = pv_gas.production_header_id(+)
          AND INITCAP (pv_gas.material_type(+)) = 'Gas'
          AND PV_GAS.MATERIAL_DISPOSITION_CODE(+) = 'ESP'
          AND PV_OIL.MATERIAL_DISPOSITION_CODE(+) = 'ESP'
          AND PV_WATER.MATERIAL_DISPOSITION_CODE(+) = 'ESP'
         -- AND PV_GAS.FLOW_DIRECTION_CODE = 'PRODUCTION'
        --  AND PV_GAS.FLOW_DIRECTION_CODE = 'PRODUCTION'
       --   AND PV_GAS.FLOW_DIRECTION_CODE = 'PRODUCTION'
          AND wc.Id = 
wcr.Well_Completion_Id(+)
          AND r.Id(+) = wcr.Reservoir_Id
          AND NVL (PV_OIL.ID, NVL (PV_gas.ID, PV_water.ID)) is not null
          --AND ph.Reporting_Period_Code  in ('Monthly' )
          AND ph.Reporting_Period_Code  in ('Monthly')
   UNION
   SELECT NVL (PV_OIL.ID, NVL (PV_gas.ID, PV_water.ID)) Id,
          w.id well_id,
          w.uwi || ':' || ts.string_type Name,
          BA.ALIAS_NAME || ':' || ts.string_type ALIAS_NAME,
          w.uwi UWI,
          NVL2 (r.name, r.name, 'Undefined') Reservoir_Name,
          ts.name String_Type,
          ph.volume_method_code production_type,
          ph.Reporting_Period_Code PRODUCTION_PARAMETER,
          ph.start_date Production_Date,
          NVL (pv_oil.volume, 0) Oil_Volume,
          NVL (pv_water.volume, 0) Water_Volume,
          NVL (pv_gas.volume, 0) Gas_Volume,
          NVL (
             PV_OIL.PRODUCTIVE_DURATION,
             NVL (PV_gas.PRODUCTIVE_DURATION, PV_water.PRODUCTIVE_DURATION))
             
Days,
          NVL (
             PV_OIL.FLOW_DIRECTION_CODE,
             NVL (PV_gas.FLOW_DIRECTION_CODE, PV_water.FLOW_DIRECTION_CODE))
             FLOW_DIRECTION_CODE,
          NVL (
             PV_OIL.MATERIAL_DISPOSITION_CODE,
             NVL (PV_gas.MATERIAL_DISPOSITION_CODE,
                  PV_water.MATERIAL_DISPOSITION_CODE))
             MATERIAL_DISPOSITION_CODE,
          bh.Id Borehole_Id,
          ts.Id Tubing_String_Id,
          pe.id Production_Entity_Id
     FROM production_header ph,
          borehole bh,
          Borehole_Alias ba,
          well w,
          well_completion wc,
          tubing_string ts,
          production_entity pe,
          production_volume pv_oil,
          production_volume pv_water,
          production_volume pv_gas,
          Well_Completion_Reservoir wcr,
          Reservoir r
    WHERE     bh.id = wc.borehole_id
          AND bh.well_id = w.id
          AND BH.UBHI = W.UWI
          AND BA.BOREHOLE_ID(+) = BH.ID
          
AND BA.ALIAS_TYPE(+) = 'SIMULATION'
          AND wc.tubing_string_id = ts.id(+)
          AND wc.id = PE.WELL_COMPLETION_ID
          AND pe.id = ph.production_entity_id
          AND pe.Production_Entity_Subtype = 'Well_Completion'
          AND ph.id = pv_oil.production_header_id(+)
          AND INITCAP (pv_oil.material_type(+)) = 'Oil'
          AND ph.id = pv_water.production_header_id(+)
          AND INITCAP (pv_water.material_type(+)) = 'Water'
          AND ph.id = pv_gas.production_header_id(+)
          AND INITCAP (pv_gas.material_type(+)) = 'Gas'
          AND PV_GAS.MATERIAL_DISPOSITION_CODE(+) = 'POWER'
          AND PV_OIL.MATERIAL_DISPOSITION_CODE(+) = 'POWER'
          AND PV_WATER.MATERIAL_DISPOSITION_CODE(+) = 'POWER'
        --  AND PV_GAS.FLOW_DIRECTION_CODE = 'INJECTION'
       --   AND PV_GAS.FLOW_DIRECTION_CODE = 'INJECTION'
        --  AND PV_GAS.FLOW_DIRECTION_CODE = 'INJECTION'
          AND wc.Id = wcr.Well_Completion_Id(+)
          AND r.Id(+) = 
wcr.Reservoir_Id
          AND NVL (PV_OIL.ID, NVL (PV_gas.ID, PV_water.ID)) is not null
          --AND ph.Reporting_Period_Code  in ('Monthly')
          AND ph.Reporting_Period_Code  in ('Monthly')
   ORDER BY 15, 6, 10
   


[Seabed Objects] [Entities in Schema Seabed] [Index]

Copyright © 2018 Schlumberger. All rights reserved.