EXP_GAE_SCAL_DOV


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

General Information

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


Columns

[Previous] [Next] [Top]
NameValue DomainProperty /
Storage Unit
DescriptionRequired /
Default
Type
AIR_CONT_ANGLE STRING64 NA
_ No
VARCHAR2(64)
AIR_TENSION STRING64 NA
_ No
VARCHAR2(64)
ALIAS_NAME STRING255 NA
_ No
VARCHAR2(255)
ANALYSIS_ORDER_NUMBER NUMBER NA
_ No
NUMBER
BOREHOLE_ID NUMBER NA
_ No
NUMBER
CRITICAL_GAS_SAT NUMBER NA
_ No
NUMBER
CURVE_TYPE STRING2000 NA
_ No
VARCHAR2(2000)
DESCRIPTION STRING2000 NA
_ No
VARCHAR2(2000)
DISPLACED_PHASE STRING64 NA
_ No
VARCHAR2(64)
FILTER_TYPE STRING4 NA
_ No
VARCHAR2(4)
GAS_GRAV STRING64 NA
_ No
VARCHAR2(64)
GAS_PERM_RSO STRING64 NA
_ No
VARCHAR2(64)
GAS_PERM_SWIMM STRING64 NA
_ No
VARCHAR2(64)
GAS_VISCOSITY STRING64 NA
_ No
VARCHAR2(64)
INIT_EXTERN_PRES STRING64 NA
_ No
VARCHAR2(64)
INIT_OIL_SAT NUMBER NA
_ No
NUMBER
INJECT_RATE STRING64 NA
_ No
VARCHAR2(64)
INVADING_PHASE STRING64 NA
_ No
VARCHAR2(64)
Id ID No_Unit
Unique identifier Yes
NUMBER(38)
KRBASIS STRING32 NA
_ No
VARCHAR2(32)
KRBASIS_VAL STRING64 NA
_ No
VARCHAR2(64)
KREXP STRING32 NA
_ No
VARCHAR2(32)
LAYER_UNIT STRING64 NA
_ No
VARCHAR2(64)
LITHOFACIES STRING64 NA
_ No
VARCHAR2(64)
LOG_DEPTH NUMBER NA
_ No
NUMBER
OIL_GRAV STRING64 NA
_ No
VARCHAR2(64)
OIL_VISCOSITY STRING64 NA
_ No
VARCHAR2(64)
OIL_WETTABILITY_INDEX STRING64 NA
_ No
VARCHAR2(64)
PCEXP STRING32 NA
_ No
VARCHAR2(32)
PLUG_TYPE STRING64 NA
_ No
VARCHAR2(64)
POROSITY NUMBER NA
_ No
NUMBER
RESID_OIL_SAT NUMBER NA
_ No
NUMBER
RESID_WATER_SAT NUMBER NA
_ No
NUMBER
ROWNUM1 NUMBER NA
_ No
NUMBER
SAMPLE_NUMBER STRING2000 NA
_ No
VARCHAR2(2000)
SCAL_ANALYSIS_ID NUMBER NA
_ No
NUMBER
SGI NUMBER NA
_ No
NUMBER
SOURCE STRING64 NA
_ No
VARCHAR2(64)
SWIMM NUMBER NA
_ No
NUMBER
TODAY STRING64 NA
_ No
VARCHAR2(64)
TOP NUMBER NA
_ No
NUMBER
TVDSS NUMBER NA
_ No
NUMBER
UBHI STRING64 NA
_ No
VARCHAR2(64)
WATER_GRAV STRING64 NA
_ No
VARCHAR2(64)
WATER_PERM_RSO STRING64 NA
_ No
VARCHAR2(64)
WATER_VISCOSITY STRING64 NA
_ No
VARCHAR2(64)
WATER_WETTABILITY_INDEX STRING64 NA
_ No
VARCHAR2(64)
WELL_ID NUMBER NA
_ No
NUMBER
ZONE STRING64 NA
_ No
VARCHAR2(64)


View Definition

[Previous] [Top]

CREATE OR REPLACE FORCE VIEW EXP_GAE_SCAL_DOV(ID, SCAL_ANALYSIS_ID, UBHI, FILTER_TYPE, CURVE_TYPE, TODAY, SAMPLE_NUMBER, DESCRIPTION, SOURCE, ZONE, LAYER_UNIT, LITHOFACIES, TOP, LOG_DEPTH, TVDSS, PLUG_TYPE, DISPLACED_PHASE, INVADING_PHASE, INJECT_RATE, INIT_EXTERN_PRES, OIL_VISCOSITY, WATER_VISCOSITY, GAS_VISCOSITY, OIL_GRAV, WATER_GRAV, GAS_GRAV, GAS_PERM_RSO, GAS_PERM_SWIMM, WATER_PERM_RSO, SWIMM, SGI, INIT_OIL_SAT, RESID_WATER_SAT, RESID_OIL_SAT, CRITICAL_GAS_SAT, POROSITY, OIL_WETTABILITY_INDEX, WATER_WETTABILITY_INDEX, AIR_CONT_ANGLE, AIR_TENSION, KRBASIS, KRBASIS_VAL, KREXP, PCEXP, BOREHOLE_ID, WELL_ID, ANALYSIS_ORDER_NUMBER, ALIAS_NAME, ROWNUM1) AS SELECT scal.*, ROWNUM
FROM (SELECT DISTINCT
		  Sa.ID ID,
		  Sa.Id SCAL_ANALYSIS_ID,
		  bh.UBHI UBHI,
		  'ZONE' Filter_Type,
		  (SELECT DISTINCT data_set_remarks
			 FROM SCAL_CURVE_DATA_SET
			WHERE SCAL_ANALYSIS_ID = Sa.id
				  AND data_set_remarks IN
						 
('OIL_WTR_PERM','OIL_GAS_PERM','GAS_WTR_PERM','CAP_PRESS_DRAIN','CAP_PRESS_IMBIB','CAP_PRESS'))
			 Curve_type,
		  TO_CHAR (SYSDATE, 'HH:MM DY Mon DD YYYY') Today,
		  NVL (
			 P.Opr_Sample_Number,
			 NVL (
				TO_CHAR (scal_transpose.Sar_ADNOC_SCAL_ID),
				   P.Parent_Rock_Sample_Id
				|| TO_CHAR (P.name)
				|| TO_CHAR (Sa.Analysis_Order_Number)))
			 Sample_Number,
		  NVL (
				Sa.Lab_File_Number
			 || TO_CHAR (Sa.Report_Date, 'DD-MON-YYYY')
			 || cp.NAME
			 || TO_CHAR (Sa.Start_Date, 'DD-MON-YYYY'),
			 'SCAL SAMPLE')
			 Description,
		  SL.SOURCE,
		  sl.standard_layer_name Zone,
		  SL.STRAT_LAYER_UNIT Layer_Unit,
		  (SELECT ISL.STANDARD_LAYER_NAME
			 FROM Borehole_Zone iz,Borehole_Point ibhp_top,Borehole_Point ibhp_base,stratigraphic_layer isl,
				  Borehole iB1
			WHERE     ib1.id = ibhp_top.borehole_id
				  AND ibhp_top.id = iz.zone_top_id
				  AND ib1.id = ibhp_base.borehole_id
				  AND ibhp_base.id = iz.zone_base_id
				  AND iz.geologic_layer_id = 
isl.ID
				  AND iSL.STRAT_LAYER_UNIT = 'FACIES'
				  AND (NVL (
						  (SELECT p.Top_Depth + RSDA.DEPTH_CORRECTION
									 Depth_Corr
							 FROM Rock_Sample_Depth_Adjust rsda,
								  Core C1,
								  Borehole b
							WHERE C1.ID = RSDA.ROCK_SAMPLE_ID
								  AND C1.BOREHOLE_ID = B.ID
								  AND P.Top_Depth BETWEEN rsda.
														  top_depth
													  AND rsda.
														  base_depth
								  AND b.ubhi = bh.ubhi
								  AND ROWNUM = 1),
						  p.top_depth)) BETWEEN ibhp_top.MD
											AND ibhp_base.MD
				  AND ib1.ubhi = bh.ubhi
				  AND ROWNUM = 1)
			 LithoFacies,
		  P.Top_Depth Top,
		  NVL (
			 (SELECT p.Top_Depth + RSDA.DEPTH_CORRECTION Depth_Corr
				FROM Rock_Sample_Depth_Adjust rsda,
					 Core C1,
					 Borehole b
			   WHERE C1.ID = RSDA.ROCK_SAMPLE_ID
					 AND C1.BOREHOLE_ID = B.ID
					 AND P.Top_Depth BETWEEN rsda.top_depth
										 AND rsda.base_depth
					 AND b.ubhi = bh.ubhi
					 AND ROWNUM = 1),
			 p.top_depth)
			 
Log_Depth,
		  CALC_WELL_POINT.
		  GetTvdSSFromMd (
			 bh.ubhi,
			 (NVL (
				 (SELECT DISTINCT
						 p.Top_Depth + RSDA.DEPTH_CORRECTION
							Depth_Corr
					FROM Rock_Sample_Depth_Adjust rsda,
						 Core C1,
						 Borehole b
				   WHERE C1.ID = RSDA.ROCK_SAMPLE_ID
						 AND C1.BOREHOLE_ID = B.ID
						 AND P.Top_Depth BETWEEN rsda.top_depth
											 AND rsda.base_depth
						 AND b.ubhi = bh.ubhi
						 AND ROWNUM = 1),
				 p.top_depth)))
			 TVDSS,
		  DECODE (P.Plug_Orient_Type,
				  'H', 'Horizontal',
				  'V', 'Vertical',
				  P.Plug_Orient_Type)
			 Plug_Type,
		  scal_transpose.Sar_Displaced_Phase Displaced_Phase,
		  scal_transpose.Sar_Invading_Phase Invading_Phase,
		  scal_transpose.Sar_Inject_Rate Inject_Rate,
		  scal_transpose.Sar_Init_Extern_Pres Init_Extern_Pres,
		  scal_transpose.Sar_Oil_Viscosity Oil_Viscosity,
		  scal_transpose.Sar_Water_Viscosity Water_Viscosity,
		  scal_transpose.Sar_Gas_Viscosity Gas_Viscosity,
		  scal_transpose.Sar_Oil_Grav 
Oil_Grav,
		  scal_transpose.Sar_Water_Grav Water_Grav,
		  scal_transpose.Sar_Gas_Grav Gas_Grav,
		  scal_transpose.Sar_Gas_Perm_RSO Gas_Perm_RSO,
		  scal_transpose.Sar_Gas_Perm_Swimm Gas_Perm_Swimm,
		  scal_transpose.Sar_Water_Perm_RSO Water_Perm_RSO,
		  TO_NUMBER (scal_transpose.Sar_Swimm) / 100 Swimm,
		  TO_NUMBER (scal_transpose.Sar_SGI) / 100 SGI,
		  TO_NUMBER (scal_transpose.Sar_Init_Oil_Sat) / 100
			 Init_Oil_Sat,
		  TO_NUMBER (scal_transpose.Sar_Resid_Water_Sat) / 100
			 Resid_Water_Sat,
		  TO_NUMBER (scal_transpose.Sar_Resid_Oil_Sat) / 100
			 Resid_Oil_Sat,
		  TO_NUMBER (scal_transpose.Sar_Crit_Gas_Sat) / 100
			 Critical_Gas_Sat,
		  scal_transpose.Sar_Por / 100 Porosity,
		  scal_transpose.Sar_Oil_Wettability_Index
			 Oil_Wettability_Index,
		  scal_transpose.Sar_Water_Wettability_Index
			 Water_Wettability_Index,
		  scal_transpose.Sar_HG_Air_Cont_Angle Air_Cont_Angle,
		  scal_transpose.Sar_Air_Tension Air_Tension,
		  DECODE 
(scal_transpose.Sar_Rel_Perm_Basis,'A', 'KAIR','O', 'KOSWI','W', 'KWSOR','PERMEABILITY')
			 KRBASIS,
		  DECODE (
			 DECODE (scal_transpose.Sar_Rel_Perm_Basis,'A', 'KAIR','O', 'KOSWI','W', 'KWSOR','PERMEABILITY'),
			 'KAIR', NVL (
						TO_CHAR (
						   NVL (
							  scal_transpose.Sar_Klinkenbarg_Permeability,scal_transpose.Sar_Perm_Air)),
						'0.000001'),
			 'KOSWI', NVL (TO_CHAR (scal_transpose.Sar_Oil_Perm_SWI),
						   '0.000001'),
			 'KWSOR', NVL (
						 TO_CHAR (scal_transpose.Sar_Water_Perm_RSO),
						 '0.000001'),
			 '0.000001')
			 KRBASIS_VAL,
		  DECODE (
			 sa.Analysis_Kind,
			 '1', DECODE (sa.Analysis_Subtype,
						  '1', 'STEADY_STATE',
						  '7', 'STEADY_STATE',
						  '4', 'CENTRIFUGE',
						  '2', 'UNSTEADY',
						  '3', 'UNSTEADY',
						  '5', 'UNSTEADY',
						  '6', 'UNSTEADY'),
			 '2', DECODE (sa.Analysis_Subtype,'1', 'STEADY','7', 'STEADY'),
			 '')
			 KREXP,
		  DECODE (
			 sa.Analysis_Kind,
			 '4', DECODE (sa.Analysis_Subtype,'1', 
'Hg','2', 'PorPlate','3', 'Centrifuge'),
			 '5', DECODE (sa.Analysis_Subtype,'1', 'Hg','2', 'PorPlate','3', 'Centrifuge'),
			 '2', DECODE (sa.Analysis_Subtype,'1', 'STEADY_STATE','7', 'STEADY_STATE'),
			 '')
			 PCEXP,
		  Bh.ID Borehole_Id,
		  BH.WELL_ID,
		  Sa.Analysis_Order_Number,
		  BA.ALIAS_NAME
	 FROM Scal_Analysis Sa,
		  (  SELECT SCAL_ANALYSIS_ID,
					MAX (
					   DECODE (SCAL_PROPERTY,'POROSITY', Scal_Property_Value_String))
					   AS Sar_Por,
					MAX (
					   DECODE (SCAL_PROPERTY,'BASE_PERMEABILITY', Scal_Property_Value_String))
					   AS Sar_Rel_Perm_Basis,
					MAX (
					   DECODE (SCAL_PROPERTY,'INIT_WATER_SAT', Scal_Property_Value_String))
					   AS Sar_Swimm,
					MAX (
					   DECODE (SCAL_PROPERTY,'RESIDUAL_OIL_SAT', Scal_Property_Value_String))
					   AS Sar_Resid_Oil_Sat,
					MAX (
					   DECODE (SCAL_PROPERTY,'CRITICAL_GAS_SAT', Scal_Property_Value_String))
					   AS Sar_Crit_Gas_Sat,
					MAX (
					   DECODE (SCAL_PROPERTY,'KG_SWI', 
Scal_Property_Value_String))
					   AS Sar_Gas_Perm_Swimm,
					MAX (
					   DECODE (SCAL_PROPERTY,'DISPLACED_PHASE', Scal_Property_Value_String))
					   AS Sar_Displaced_Phase,
					MAX (
					   DECODE (SCAL_PROPERTY,'INVADING_PHASE', Scal_Property_Value_String))
					   AS Sar_Invading_Phase,
					MAX (
					   DECODE (SCAL_PROPERTY,'INJECT_RATE', Scal_Property_Value_String))
					   AS Sar_Inject_Rate,
					MAX (
					   DECODE (SCAL_PROPERTY,'INIT_EXTERN_PRES', Scal_Property_Value_String))
					   AS Sar_Init_Extern_Pres,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_VISCOSITY', Scal_Property_Value_String))
					   AS Sar_Oil_Viscosity,
					MAX (
					   DECODE (SCAL_PROPERTY,'WATER_VISCOSITY', Scal_Property_Value_String))
					   AS Sar_Water_Viscosity,
					MAX (
					   DECODE (SCAL_PROPERTY,'GAS_VISCOSITY', Scal_Property_Value_String))
					   AS Sar_Gas_Viscosity,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_GRAV', Scal_Property_Value_String))
					   AS 
Sar_Oil_Grav,
					MAX (
					   DECODE (SCAL_PROPERTY,'WATER_GRAV', Scal_Property_Value_String))
					   AS Sar_Water_Grav,
					MAX (
					   DECODE (SCAL_PROPERTY,'GAS_GRAV', Scal_Property_Value_String))
					   AS Sar_Gas_Grav,
					MAX (
					   DECODE (SCAL_PROPERTY,'GAS_PERM_RSO', Scal_Property_Value_String))
					   AS Sar_Gas_Perm_RSO,
					MAX (
					   DECODE (SCAL_PROPERTY,'WATER_PERM_RSO', Scal_Property_Value_String))
					   AS Sar_Water_Perm_RSO,
					MAX (
					   DECODE (SCAL_PROPERTY,'SGI', Scal_Property_Value_String))
					   AS Sar_SGI,
					MAX (
					   DECODE (SCAL_PROPERTY,'INIT_OIL_SAT', Scal_Property_Value_String))
					   AS Sar_Init_Oil_Sat,
					MAX (
					   DECODE (SCAL_PROPERTY,'RESIDUAL_WATER_SAT', Scal_Property_Value_String))
					   AS Sar_Resid_Water_Sat,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_WETTABILITY_INDEX', Scal_Property_Value_String))
					   AS Sar_Oil_Wettability_Index,
					MAX (
					   DECODE 
(SCAL_PROPERTY,'WATER_WETTABILITY_INDEX', Scal_Property_Value_String))
					   AS Sar_Water_Wettability_Index,
					MAX (
					   DECODE (SCAL_PROPERTY,'HG_AIR_CONT_ANGLE', Scal_Property_Value_String))
					   AS Sar_HG_Air_Cont_Angle,
					MAX (
					   DECODE (SCAL_PROPERTY,'HG_AIR_TENSION', Scal_Property_Value_String))
					   AS Sar_Air_Tension,
					MAX (
					   DECODE (SCAL_PROPERTY,'ADNOC_SCAL_ID', Scal_Property_Value_String))
					   AS Sar_ADNOC_SCAL_ID,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_PERM_SWI', Scal_Property_Value_String))
					   AS Sar_Oil_Perm_SWI,
					MAX (
					   DECODE (SCAL_PROPERTY,'PERM_AIR', Scal_Property_Value_String))
					   AS Sar_Perm_Air,
					MAX (
					   DECODE (SCAL_PROPERTY,'KLINKENBARG_PERMEABILITY', Scal_Property_Value_String))
					   AS Sar_Klinkenbarg_Permeability
			   FROM SCAL_ANALYSIS_RESULT
		   GROUP BY SCAL_ANALYSIS_ID) scal_transpose,
		  Plug P,
		  Core C,
		  Borehole Bh,
		  Borehole_Alias ba,
		  Company cp,
		  
rock_sample_stratigraphy rss,
		  stratigraphic_layer sl
	WHERE     Sa.Rock_Sample_Id = P.ID
		  AND p.sample_type LIKE 'SCAL%'
		  AND P.ID = rss.rock_sample_id(+)
		  AND rss.geologic_layer_id = sl.ID(+)
		  AND P.Parent_Rock_Sample_Id = C.ID
		  AND C.Borehole_Id = Bh.ID
		  AND BA.BOREHOLE_ID(+) = BH.ID
		  AND BA.ALIAS_TYPE(+) = 'SIMULATION'
		  AND Sa.Lab_Business_Associate_Id = Cp.ID(+)
		  AND scal_transpose.scal_analysis_id(+) = sa.id
		  AND Sa.Id IN
				 (SELECT DISTINCT Scal_Analysis_Id
					FROM SCAL_CURVE_DATA_SET
				   WHERE data_set_remarks IN
							('OIL_WTR_PERM',
							 'OIL_GAS_PERM',
							 'GAS_WTR_PERM',
							 'CAP_PRESS_DRAIN',
							 'CAP_PRESS_IMBIB',
							 'CAP_PRESS'))
   UNION
   SELECT DISTINCT
		  TO_NUMBER (
				SUBSTR (Sa.ID, -4)
			 || SUBSTR (SL.ID, -4)
			 || SUBSTR (RSDA.ID, -2))
			 ID,
		  Sa.id SCAL_ANALYSIS_ID,
		  bh.UBHI UBHI,
		  'ROCK' Filter_Type,
		  (SELECT DISTINCT data_set_remarks
			 FROM SCAL_CURVE_DATA_SET
			WHERE 
SCAL_ANALYSIS_ID = Sa.id
				  AND data_set_remarks IN
						 ('OIL_WTR_PERM',
						  'OIL_GAS_PERM',
						  'GAS_WTR_PERM',
						  'CAP_PRESS_DRAIN',
						  'CAP_PRESS_IMBIB',
						  'CAP_PRESS'))
			 Curve_type,
		  TO_CHAR (SYSDATE, 'HH:MM DY Mon DD YYYY') Today,
		  NVL (
			 P.Opr_Sample_Number,
			 NVL (
				TO_CHAR (scal_transpose.Sar_ADNOC_SCAL_ID),
				   P.Parent_Rock_Sample_Id
				|| TO_CHAR (P.name)
				|| TO_CHAR (Sa.Analysis_Order_Number)))
			 Sample_Number,
		  NVL (
				Sa.Lab_File_Number
			 || TO_CHAR (Sa.Report_Date, 'DD-MON-YYYY')
			 || cp.NAME
			 || TO_CHAR (Sa.Start_Date, 'DD-MON-YYYY'),
			 'SCAL SAMPLE')
			 Description,
		  SL.SOURCE,
		  NVL (SL_RESLAY.STANDARD_LAYER_NAME, sl.standard_layer_name)
			 Zone,
		  SL.STRAT_LAYER_UNIT Layer_Unit,
		  (SELECT ISL.STANDARD_LAYER_NAME
			 FROM Borehole_Zone iz,
				  Borehole_Point ibhp_top,
				  Borehole_Point ibhp_base,
				  stratigraphic_layer isl,
				  Borehole iB1
			WHERE     ib1.id = 
ibhp_top.borehole_id
				  AND ibhp_top.id = iz.zone_top_id
				  AND ib1.id = ibhp_base.borehole_id
				  AND ibhp_base.id = iz.zone_base_id
				  AND iz.geologic_layer_id = isl.ID
				  AND iSL.STRAT_LAYER_UNIT = 'FACIES'
				  AND P.TOP_DEPTH + RSDA.DEPTH_CORRECTION BETWEEN ibhp_top.
																  MD
															  AND ibhp_base.
																  MD
				  AND ib1.ubhi = bh.ubhi
				  AND ROWNUM = 1)
			 LithoFacies,
		  P.Top_Depth Top,
		  P.Top_Depth + RSDA.DEPTH_CORRECTION Log_Depth,
		  CALC_WELL_POINT.
		  GetTvdSSFromMd (bh.ubhi,
						  (P.Top_Depth + RSDA.DEPTH_CORRECTION))
			 TVDSS,
		  DECODE (P.Plug_Orient_Type,
				  'H', 'Horizontal',
				  'V', 'Vertical',
				  P.Plug_Orient_Type)
			 Plug_Type,
		  scal_transpose.Sar_Displaced_Phase Displaced_Phase,
		  scal_transpose.Sar_Invading_Phase Invading_Phase,
		  scal_transpose.Sar_Inject_Rate Inject_Rate,
		  scal_transpose.Sar_Init_Extern_Pres Init_Extern_Pres,
		  scal_transpose.Sar_Oil_Viscosity 
Oil_Viscosity,
		  scal_transpose.Sar_Water_Viscosity Water_Viscosity,
		  scal_transpose.Sar_Gas_Viscosity Gas_Viscosity,
		  scal_transpose.Sar_Oil_Grav Oil_Grav,
		  scal_transpose.Sar_Water_Grav Water_Grav,
		  scal_transpose.Sar_Gas_Grav Gas_Grav,
		  scal_transpose.Sar_Gas_Perm_RSO Gas_Perm_RSO,
		  scal_transpose.Sar_Gas_Perm_Swimm Gas_Perm_Swimm,
		  scal_transpose.Sar_Water_Perm_RSO Water_Perm_RSO,
		  TO_NUMBER (scal_transpose.Sar_Swimm) / 100 Swimm,
		  TO_NUMBER (scal_transpose.Sar_SGI) / 100 SGI,
		  TO_NUMBER (scal_transpose.Sar_Init_Oil_Sat) / 100
			 Init_Oil_Sat,
		  TO_NUMBER (scal_transpose.Sar_Resid_Water_Sat) / 100
			 Resid_Water_Sat,
		  TO_NUMBER (scal_transpose.Sar_Resid_Oil_Sat) / 100
			 Resid_Oil_Sat,
		  TO_NUMBER (scal_transpose.Sar_Crit_Gas_Sat) / 100
			 Critical_Gas_Sat,
		  scal_transpose.Sar_Por / 100 Porosity,
		  scal_transpose.Sar_Oil_Wettability_Index
			 Oil_Wettability_Index,
		  scal_transpose.Sar_Water_Wettability_Index
			 
Water_Wettability_Index,
		  scal_transpose.Sar_HG_Air_Cont_Angle Air_Cont_Angle,
		  scal_transpose.Sar_Air_Tension Air_Tension,
		  DECODE (Sar_Rel_Perm_Basis,
				  'A', 'KAIR',
				  'O', 'KOSWI',
				  'W', 'KWSOR',
				  'PERMEABILITY')
			 KRBASIS,
		  DECODE (
			 DECODE (scal_transpose.Sar_Rel_Perm_Basis,
					 'A', 'KAIR',
					 'O', 'KOSWI',
					 'W', 'KWSOR',
					 'PERMEABILITY'),
			 'KAIR', NVL (
						TO_CHAR (
						   NVL (
							  scal_transpose.
							  Sar_Klinkenbarg_Permeability,
							  scal_transpose.Sar_Perm_Air)),
						'0.000001'),
			 'KOSWI', NVL (TO_CHAR (scal_transpose.Sar_Oil_Perm_SWI),
						   '0.000001'),
			 'KWSOR', NVL (
						 TO_CHAR (scal_transpose.Sar_Water_Perm_RSO),
						 '0.000001'),
			 '0.000001')
			 KRBASIS_VAL,
		  DECODE (
			 sa.Analysis_Kind,
			 '1', DECODE (sa.Analysis_Method,
						  '1', 'STEADY_STATE',
						  '7', 'STEADY_STATE',
						  '4', 'CENTRIFUGE',
						  '2', 'UNSTEADY',
						  '3', 'UNSTEADY',
						  '5', 
'UNSTEADY',
						  '6', 'UNSTEADY'),
			 '2', DECODE (sa.Analysis_Method,
						  '1', 'STEADY',
						  '7', 'STEADY'),
			 '')
			 KREXP,
		  DECODE (
			 sa.Analysis_Kind,
			 '4', DECODE (sa.Analysis_Method,
						  '1', 'Hg',
						  '2', 'PorPlate',
						  '3', 'Centrifuge'),
			 '5', DECODE (sa.Analysis_Method,
						  '1', 'Hg',
						  '2', 'PorPlate',
						  '3', 'Centrifuge'),
			 '2', DECODE (sa.Analysis_Method,
						  '1', 'STEADY_STATE',
						  '7', 'STEADY_STATE'),
			 '')
			 PCEXP,
		  Bh.ID Borehole_Id,
		  BH.WELL_ID,
		  Sa.Analysis_Order_Number,
		  BA.ALIAS_NAME
	 FROM Scal_Analysis Sa,
		  (  SELECT SCAL_ANALYSIS_ID,
					MAX (
					   DECODE (SCAL_PROPERTY,'POROSITY', Scal_Property_Value_String))
					   AS Sar_Por,
					MAX (
					   DECODE (SCAL_PROPERTY,'BASE_PERMEABILITY', Scal_Property_Value_String))
					   AS Sar_Rel_Perm_Basis,
					MAX (
					   DECODE (SCAL_PROPERTY,'INIT_WATER_SAT', Scal_Property_Value_String))
					   AS Sar_Swimm,
					MAX 
(
					   DECODE (SCAL_PROPERTY,'RESIDUAL_OIL_SAT', Scal_Property_Value_String))
					   AS Sar_Resid_Oil_Sat,
					MAX (
					   DECODE (SCAL_PROPERTY,'CRITICAL_GAS_SAT', Scal_Property_Value_String))
					   AS Sar_Crit_Gas_Sat,
					MAX (
					   DECODE (SCAL_PROPERTY,'KG_SWI', Scal_Property_Value_String))
					   AS Sar_Gas_Perm_Swimm,
					MAX (
					   DECODE (SCAL_PROPERTY,'DISPLACED_PHASE', Scal_Property_Value_String))
					   AS Sar_Displaced_Phase,
					MAX (
					   DECODE (SCAL_PROPERTY,'INVADING_PHASE', Scal_Property_Value_String))
					   AS Sar_Invading_Phase,
					MAX (
					   DECODE (SCAL_PROPERTY,'INJECT_RATE', Scal_Property_Value_String))
					   AS Sar_Inject_Rate,
					MAX (
					   DECODE (SCAL_PROPERTY,'INIT_EXTERN_PRES', Scal_Property_Value_String))
					   AS Sar_Init_Extern_Pres,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_VISCOSITY', Scal_Property_Value_String))
					   AS Sar_Oil_Viscosity,
					MAX (
					   DECODE (SCAL_PROPERTY,'WATER_VISCOSITY', 
Scal_Property_Value_String))
					   AS Sar_Water_Viscosity,
					MAX (
					   DECODE (SCAL_PROPERTY,'GAS_VISCOSITY', Scal_Property_Value_String))
					   AS Sar_Gas_Viscosity,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_GRAV', Scal_Property_Value_String))
					   AS Sar_Oil_Grav,
					MAX (
					   DECODE (SCAL_PROPERTY,'WATER_GRAV', Scal_Property_Value_String))
					   AS Sar_Water_Grav,
					MAX (
					   DECODE (SCAL_PROPERTY,'GAS_GRAV', Scal_Property_Value_String))
					   AS Sar_Gas_Grav,
					MAX (
					   DECODE (SCAL_PROPERTY,'GAS_PERM_RSO', Scal_Property_Value_String))
					   AS Sar_Gas_Perm_RSO,
					MAX (
					   DECODE (SCAL_PROPERTY,'WATER_PERM_RSO', Scal_Property_Value_String))
					   AS Sar_Water_Perm_RSO,
					MAX (
					   DECODE (SCAL_PROPERTY,'SGI', Scal_Property_Value_String))
					   AS Sar_SGI,
					MAX (
					   DECODE (SCAL_PROPERTY,'INIT_OIL_SAT', Scal_Property_Value_String))
					   AS Sar_Init_Oil_Sat,
					MAX (
					   DECODE 
(SCAL_PROPERTY,'RESIDUAL_WATER_SAT', Scal_Property_Value_String))
					   AS Sar_Resid_Water_Sat,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_WETTABILITY_INDEX', Scal_Property_Value_String))
					   AS Sar_Oil_Wettability_Index,
					MAX (
					   DECODE (SCAL_PROPERTY,'WATER_WETTABILITY_INDEX', Scal_Property_Value_String))
					   AS Sar_Water_Wettability_Index,
					MAX (
					   DECODE (SCAL_PROPERTY,'HG_AIR_CONT_ANGLE', Scal_Property_Value_String))
					   AS Sar_HG_Air_Cont_Angle,
					MAX (
					   DECODE (
						  SCAL_PROPERTY,'HG_AIR_TENSION', Scal_Property_Value_String))
					   AS Sar_Air_Tension,
					MAX (
					   DECODE (SCAL_PROPERTY,'ADNOC_SCAL_ID', Scal_Property_Value_String))
					   AS Sar_ADNOC_SCAL_ID,
					MAX (
					   DECODE (SCAL_PROPERTY,'OIL_PERM_SWI', Scal_Property_Value_String))
					   AS Sar_Oil_Perm_SWI,
					MAX (
					   DECODE (SCAL_PROPERTY,'PERM_AIR', Scal_Property_Value_String))
					   AS Sar_Perm_Air,
					MAX (
					   DECODE 
(SCAL_PROPERTY,'KLINKENBARG_PERMEABILITY', Scal_Property_Value_String))
					   AS Sar_Klinkenbarg_Permeability
			   FROM SCAL_ANALYSIS_RESULT
		   GROUP BY SCAL_ANALYSIS_ID) scal_transpose,
		  Plug P,
		  Core C,
		  Core C1,
		  Borehole Bh,
		  Borehole_Alias ba,
		  Borehole_Zone z,
		  Borehole_Point bhp_top,
		  Borehole_Point bhp_base,
		  Company cp,
		  Rock_Sample_Depth_Adjust rsda,
		  stratigraphic_layer sl,
		  stratigraphic_layer sl_Reslay,
		  stratigraphic_layer sl_Facies
	WHERE     Sa.Rock_Sample_Id(+) = P.ID
		  AND p.sample_type LIKE 'SCAL%'
		  AND P.Parent_Rock_Sample_Id = C.ID
		  AND C1.ID = RSDA.ROCK_SAMPLE_ID(+)
		  AND P.TOP_DEPTH BETWEEN RSDA.TOP_DEPTH AND RSDA.BASE_DEPTH
		  AND ROUND ( (P.TOP_DEPTH + NVL (RSDA.DEPTH_CORRECTION, 0)),
					 2) BETWEEN ROUND (BHP_TOP.MD, 2)
							AND ROUND (BHP_BASE.MD, 2)
		  AND bh.id = bhp_top.borehole_id
		  AND bhp_top.id = z.zone_top_id
		  AND bh.id = bhp_base.borehole_id
		  AND bhp_base.id = z.zone_base_id
		  AND 
C.Borehole_Id = Bh.ID
		  AND BA.BOREHOLE_ID(+) = BH.ID
		  AND BA.ALIAS_TYPE(+) = 'SIMULATION'
		  AND C1.BOREHOLE_ID = BH.ID
		  AND z.geologic_layer_id = sl.ID(+)
		  AND z.geologic_layer_id = sl_Reslay.ID(+)
		  AND z.geologic_layer_id = sl_Facies.ID(+)
		  AND Sa.Lab_Business_Associate_Id = Cp.ID(+)
		  AND scal_transpose.scal_analysis_id(+) = sa.id
		  AND SL_RESLAY.STRAT_LAYER_UNIT(+) = 'RESLAY'
		  AND SL_FACIES.STRAT_LAYER_UNIT(+) = 'FACIES'
		  AND SA.ID IN
				 (SELECT DISTINCT Scal_Analysis_Id
					FROM SCAL_CURVE_DATA_SET
				   WHERE data_set_remarks IN
							('OIL_WTR_PERM',
							 'OIL_GAS_PERM',
							 'GAS_WTR_PERM',
							 'CAP_PRESS_DRAIN',
							 'CAP_PRESS_IMBIB',
							 'CAP_PRESS'))
   ORDER BY 5, 10, 47) scal
   


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

Copyright © 2018 Schlumberger. All rights reserved.