[Home] [Help]
516: p_fact_map_id,
517: p_fact_src,
518: p_fact_target
519: from
520: edw_facts_md_v fact,
521: edw_pvt_map_properties_md_v fact_map
522: where
523: fact.fact_name=p_fact_name
524: and fact_map.primary_target=fact.fact_id;
544: end if;
545: l_log_desc :=p_log;
546: l_log_table:=null;
547: --p_table is the fact name
548: l_stmt:='select rel.name from edw_tables_md_v rel, edw_facts_md_v fact, edw_foreign_keys_md_v fk, '||
549: 'edw_unique_keys_md_v pk where fact.fact_name=:a and fk.entity_id=rel.elementid '||
550: 'and pk.entity_id=fact.fact_id and fk.key_id=pk.key_id '||
551: 'and fk.foreign_key_name like ''%_DLOG''';
552: open cv for l_stmt using p_table;
552: open cv for l_stmt using p_table;
553: fetch cv into l_log_table;
554: close cv;
555: if l_log_table is null then
556: l_stmt:='select rel.RELATION_NAME from edw_relations_md_v rel, edw_facts_md_v fact, edw_foreign_keys_md_v fk, '||
557: 'edw_unique_keys_md_v pk where fact.fact_name=:a and fk.entity_id=rel.RELATION_ID '||
558: 'and pk.entity_id=fact.fact_id and fk.key_id=pk.key_id '||
559: 'and rel.description=:b';
560: open cv for l_stmt using p_table,l_log_desc;
1571: write_to_log_file_n('In is_source_for_inc_derived_fact, input param='||p_fact);
1572: end if;
1573: if g_read_cfig_options then
1574: --not checked
1575: l_stmt:='select df.fact_id from edw_facts_md_v df, edw_facts_md_v fact, '||
1576: 'edw_pvt_map_properties_md_v map '||
1577: 'where fact.fact_name=:a and map.primary_source=fact.fact_id and df.fact_id=map.primary_target ';
1578: if g_debug then
1579: write_to_log_file_n(l_stmt||' '||p_fact);
1602: l_var:=0;
1603: end if;
1604: else
1605: --not checked
1606: l_stmt:='select 1 from edw_facts_md_v df, edw_facts_md_v fact, '||
1607: 'edw_pvt_map_properties_md_v map, edw_attribute_sets_md_v sis '||
1608: 'where fact.fact_name=:a and map.primary_source=fact.fact_id and df.fact_id=map.primary_target '||
1609: 'and sis.entity_id=df.fact_id and sis.attribute_group_name=''EDW_INC_REFRESH''';
1610: if g_debug then
1638: if g_debug then
1639: write_to_log_file_n('In get_all_derived_facts, input param='||p_object);
1640: end if;
1641: --not checked
1642: l_stmt:='select df.fact_name, df.fact_id, map.mapping_id from edw_facts_md_v df, edw_facts_md_v fact, '||
1643: 'edw_pvt_map_properties_md_v map '||
1644: 'where fact.fact_name=:a and map.primary_source=fact.fact_id and df.fact_id=map.primary_target';
1645: if g_debug then
1646: write_to_log_file_n('Going to execute '||l_stmt||' using '||p_object);
2489: else
2490: l_res:=0;
2491: end if;
2492: else
2493: l_stmt:='select 1 from edw_facts_md_v fact, edw_attribute_sets_md_v sis '||
2494: ' where fact.fact_name=:a and sis.entity_id=fact.fact_id and sis.attribute_group_name=''EDW_INC_REFRESH''';
2495: if g_debug then
2496: write_to_log_file_n('Going to execute '||l_stmt);
2497: end if;
4048: 'from '||
4049: 'edw_pvt_map_sources_md_v ru, '||
4050: 'edw_dimensions_md_v rel, '||
4051: 'edw_pvt_map_properties_md_v map, '||
4052: 'edw_facts_md_v src, '||
4053: 'edw_facts_md_v tgt, '||
4054: 'edw_attribute_sets_md_v sis '||
4055: 'where '||
4056: 'ru.mapping_id=map.mapping_id '||
4049: 'edw_pvt_map_sources_md_v ru, '||
4050: 'edw_dimensions_md_v rel, '||
4051: 'edw_pvt_map_properties_md_v map, '||
4052: 'edw_facts_md_v src, '||
4053: 'edw_facts_md_v tgt, '||
4054: 'edw_attribute_sets_md_v sis '||
4055: 'where '||
4056: 'ru.mapping_id=map.mapping_id '||
4057: 'and rel.dim_id=ru.source_id '||
4068: 'from '||
4069: 'edw_pvt_map_sources_md_v ru, '||
4070: 'edw_dimensions_md_v rel, '||
4071: 'edw_pvt_map_properties_md_v map, '||
4072: 'edw_facts_md_v src, '||
4073: 'edw_facts_md_v tgt '||
4074: 'where '||
4075: 'ru.mapping_id=map.mapping_id '||
4076: 'and rel.dim_id=ru.source_id '||
4069: 'edw_pvt_map_sources_md_v ru, '||
4070: 'edw_dimensions_md_v rel, '||
4071: 'edw_pvt_map_properties_md_v map, '||
4072: 'edw_facts_md_v src, '||
4073: 'edw_facts_md_v tgt '||
4074: 'where '||
4075: 'ru.mapping_id=map.mapping_id '||
4076: 'and rel.dim_id=ru.source_id '||
4077: 'and rel.dim_name=:a '||
4754: Begin
4755: if g_debug then
4756: write_to_log_file_n('In is_src_of_custom_inc_derv_fact, input param='||p_fact);
4757: end if;
4758: l_stmt:='select 1 from edw_facts_md_v df, edw_facts_md_v fact, '||
4759: 'edw_pvt_map_properties_md_v map, edw_attribute_sets_md_v sis '||
4760: 'where fact.fact_name=:a and map.primary_source=fact.fact_id and df.fact_id=map.primary_target '||
4761: 'and sis.entity_id=df.fact_id and sis.attribute_group_name=''EDW_CUSTOM_INC_REFRESH''';
4762: open cv for l_stmt using p_fact;
5404: close cv;
5405: if l_res=1 then
5406: return 'DIMENSION';
5407: end if;
5408: l_stmt:='select 1 from edw_facts_md_v where fact_name=:a';
5409: open cv for l_stmt using p_object_name;
5410: fetch cv into l_res;
5411: close cv;
5412: if l_res=1 then