DBA Data[Home] [Help]

APPS.MSC_PHUB_UTIL dependencies on MSC_PHUB_UTIL

Line 1: PACKAGE BODY msc_phub_util AS

1: PACKAGE BODY msc_phub_util AS
2: /* $Header: MSCHBUTB.pls 120.56.12020000.2 2012/10/11 14:01:48 wexia ship $ */
3:
4: g_log_dir varchar2(250) := null;
5: g_log_file varchar2(250) := null;

Line 32: l_rate := msc_phub_util.get_conversion_rate(l_func_currency, p_sr_instance_id, p_date);

28: from msc_trading_partners
29: where sr_instance_id = p_sr_instance_id
30: and organization_id = p_organization_id
31: and partner_type = 3;*/
32: l_rate := msc_phub_util.get_conversion_rate(l_func_currency, p_sr_instance_id, p_date);
33: return l_rate;
34: end get_conversion_rate;
35:
36: function get_planning_hub_message(p_mesg_code varchar2) return varchar2 is

Line 430: log('msc_phub_util.report_decode_error.exception: '||sqlerrm);

426: return l_result;
427:
428: exception
429: when others then
430: log('msc_phub_util.report_decode_error.exception: '||sqlerrm);
431: return 1;
432: end report_decode_error;
433:
434: function decode_organization_key(p_staging_table varchar2, p_st_transaction_id number,

Line 463: log('msc_phub_util.decode_organization_key.exception: '||sqlerrm);

459: return report_decode_error(p_staging_table, p_st_transaction_id, conv_key_err_organization, p_organization_code_col);
460:
461: exception
462: when others then
463: log('msc_phub_util.decode_organization_key.exception: '||sqlerrm);
464: return 1;
465: end decode_organization_key;
466:
467: function decode_item_key(p_staging_table varchar2, p_st_transaction_id number,

Line 487: log('msc_phub_util.decode_item_key.exception: '||sqlerrm);

483: return report_decode_error(p_staging_table, p_st_transaction_id, conv_key_err_item, p_item_name_col);
484:
485: exception
486: when others then
487: log('msc_phub_util.decode_item_key.exception: '||sqlerrm);
488: return 1;
489: end decode_item_key;
490:
491: function decode_item_key2(p_staging_table varchar2, p_st_transaction_id number,

Line 522: log('msc_phub_util.decode_item_key2.exception: '||sqlerrm);

518: return report_decode_error(p_staging_table, p_st_transaction_id, conv_key_err_item, p_item_name_col);
519:
520: exception
521: when others then
522: log('msc_phub_util.decode_item_key2.exception: '||sqlerrm);
523: return 1;
524: end decode_item_key2;
525:
526: function decode_category_key(p_staging_table varchar2, p_st_transaction_id number)

Line 559: log('msc_phub_util.decode_category_key.exception: '||sqlerrm);

555: 'category_set_id,category_instance_id,category_name');
556:
557: exception
558: when others then
559: log('msc_phub_util.decode_category_key.exception: '||sqlerrm);
560: return 1;
561: end decode_category_key;
562:
563: function decode_customer_key(p_staging_table varchar2, p_st_transaction_id number,

Line 634: log('msc_phub_util.decode_customer_key.exception: '||sqlerrm);

630: return report_decode_error(p_staging_table, p_st_transaction_id, conv_key_err_customer, substr(l_report_cols,3));
631:
632: exception
633: when others then
634: log('msc_phub_util.decode_customer_key.exception: '||sqlerrm);
635: return 1;
636: end decode_customer_key;
637:
638: function decode_supplier_key(p_staging_table varchar2, p_st_transaction_id number,

Line 666: log('msc_phub_util.decode_supplier_key.exception: '||sqlerrm);

662: p_supplier_name_col||','||p_supplier_site_code_col);
663:
664: exception
665: when others then
666: log('msc_phub_util.decode_supplier_key.exception: '||sqlerrm);
667: return 1;
668: end decode_supplier_key;
669:
670: function decode_resource_key(p_staging_table varchar2, p_st_transaction_id number)

Line 697: log('msc_phub_util.decode_resource_key.exception: '||sqlerrm);

693: 'department_code,department_class,resource_code,resource_group_name,organization_code');
694:
695: exception
696: when others then
697: log('msc_phub_util.decode_resource_key.exception: '||sqlerrm);
698: return 1;
699: end decode_resource_key;
700:
701: function decode_project_key(p_staging_table varchar2, p_st_transaction_id number)

Line 725: log('msc_phub_util.decode_project_key.exception: '||sqlerrm);

721: 'project_number,task_number,organization_code');
722:
723: exception
724: when others then
725: log('msc_phub_util.decode_project_key.exception: '||sqlerrm);
726: return 1;
727: end decode_project_key;
728:
729: function prepare_staging_dates(p_staging_table varchar2,

Line 738: log('msc_phub_util.prepare_staging_dates('||p_staging_table||','||

734: is
735: l_sql varchar2(1000);
736: l_result number := 0;
737: begin
738: log('msc_phub_util.prepare_staging_dates('||p_staging_table||','||
739: date_col||','||p_st_transaction_id||','||
740: p_upload_mode||','||p_overwrite_after_date||','||
741: p_plan_start_date||','||p_plan_cutoff_date||')');
742:

Line 754: log('msc_phub_util.prepare_staging_dates:'||l_sql||', rowcount='||sql%rowcount);

750: ' set error_code=:error_code'||
751: ' where st_transaction_id=:p_st_transaction_id'||
752: ' and ('||date_col||'nvl(:p_plan_cutoff_date,'||date_col||'))';
753: execute immediate l_sql using conv_key_err_date, p_st_transaction_id, p_plan_start_date, p_plan_cutoff_date;
754: log('msc_phub_util.prepare_staging_dates:'||l_sql||', rowcount='||sql%rowcount);
755:
756: if (l_result > 0) then
757: l_result := 1;
758: end if;

Line 762: if (p_upload_mode = msc_phub_util.upload_append and

758: end if;
759: commit;
760: */
761:
762: if (p_upload_mode = msc_phub_util.upload_append and
763: p_overwrite_after_date is not null) then
764: l_sql :=
765: ' update '||p_staging_table||
766: ' set error_code=:error_code'||

Line 770: log('msc_phub_util.prepare_staging_dates:'||l_sql||', rowcount='||sql%rowcount);

766: ' set error_code=:error_code'||
767: ' where st_transaction_id=:p_st_transaction_id'||
768: ' and '||date_col||'<=:p_overwrite_after_date';
769: execute immediate l_sql using conv_date_filtered, p_st_transaction_id, p_overwrite_after_date;
770: log('msc_phub_util.prepare_staging_dates:'||l_sql||', rowcount='||sql%rowcount);
771: end if;
772: commit;
773: return l_result;
774:

Line 777: log('msc_phub_util.prepare_staging_dates.exception: '||sqlerrm);

773: return l_result;
774:
775: exception
776: when others then
777: log('msc_phub_util.prepare_staging_dates.exception: '||sqlerrm);
778: return 1;
779: end prepare_staging_dates;
780:
781: function prepare_fact_dates(p_fact_table varchar2, p_is_plan_data number,

Line 789: log('msc_phub_util.prepare_fact_dates('||p_fact_table||','||

785: is
786: l_sql varchar2(1000);
787: l_plan_clause varchar2(100);
788: begin
789: log('msc_phub_util.prepare_fact_dates('||p_fact_table||','||
790: p_is_plan_data||','||date_col||','||
791: p_plan_id||','||p_plan_run_id||','||
792: p_upload_mode||','||p_overwrite_after_date||')');
793:

Line 798: if (p_upload_mode = msc_phub_util.upload_append and

794: if (p_is_plan_data = 1) then
795: l_plan_clause := 'plan_id=:p_plan_id and plan_run_id=:p_plan_run_id';
796: end if;
797:
798: if (p_upload_mode = msc_phub_util.upload_append and
799: p_overwrite_after_date is not null and
800: date_col is not null) then
801: l_sql := 'delete from '||p_fact_table||
802: ' where '||date_col||'>:p_overwrite_after_date';

Line 809: log('msc_phub_util.prepare_fact_dates:'||sql%rowcount);

805: execute immediate l_sql using p_overwrite_after_date, p_plan_id, p_plan_run_id;
806: else
807: execute immediate l_sql using p_overwrite_after_date;
808: end if;
809: log('msc_phub_util.prepare_fact_dates:'||sql%rowcount);
810: end if;
811:
812: if (p_upload_mode = msc_phub_util.upload_replace) then
813: l_sql := ' delete from '||p_fact_table;

Line 812: if (p_upload_mode = msc_phub_util.upload_replace) then

808: end if;
809: log('msc_phub_util.prepare_fact_dates:'||sql%rowcount);
810: end if;
811:
812: if (p_upload_mode = msc_phub_util.upload_replace) then
813: l_sql := ' delete from '||p_fact_table;
814: if (p_is_plan_data = 1) then
815: l_sql := l_sql||' where '||l_plan_clause;
816: execute immediate l_sql using p_plan_id, p_plan_run_id;

Line 820: log('msc_phub_util.prepare_fact_dates:'||sql%rowcount);

816: execute immediate l_sql using p_plan_id, p_plan_run_id;
817: else
818: execute immediate l_sql;
819: end if;
820: log('msc_phub_util.prepare_fact_dates:'||sql%rowcount);
821: end if;
822: commit;
823: return 0;
824:

Line 827: log('msc_phub_util.prepare_fact_dates.exception: '||sqlerrm);

823: return 0;
824:
825: exception
826: when others then
827: log('msc_phub_util.prepare_fact_dates.exception: '||sqlerrm);
828: return 1;
829: end prepare_fact_dates;
830:
831: function applsys_schema return varchar2

Line 845: log('msc_phub_util.applsys_schema.exception: '||sqlerrm);

841: return l_schema;
842:
843: exception
844: when others then
845: log('msc_phub_util.applsys_schema.exception: '||sqlerrm);
846: return null;
847: end applsys_schema;
848:
849: function apps_schema return varchar2

Line 939: log('msc_phub_util.get_resource_rn_qid, l_qid='||l_qid||', count='||sql%rowcount);

935: and mra.simulation_set is null
936: and trunc(trunc(mra.shift_date)) between mpr.plan_start_date and mpr.plan_cutoff_date
937: and mra.refresh_number > mpr.lcid;
938:
939: log('msc_phub_util.get_resource_rn_qid, l_qid='||l_qid||', count='||sql%rowcount);
940: commit;
941: return l_qid;
942: end get_resource_rn_qid;
943:

Line 989: log('msc_phub_util.get_item_rn_qid, l_qid='||l_qid||', count='||sql%rowcount);

985: and md.sr_instance_id = mpr.sr_instance_id
986: and trunc(nvl(md.firm_date,md.using_assembly_demand_date)) between mpr.plan_start_date and mpr.plan_cutoff_date
987: and md.refresh_number > mpr.lcid;
988:
989: log('msc_phub_util.get_item_rn_qid, l_qid='||l_qid||', count='||sql%rowcount);
990: commit;
991: return l_qid;
992: end get_item_rn_qid;
993:

Line 1031: log('msc_phub_util.get_reporting_dates, l_qid_last_date='||l_qid_last_date||', count='||sql%rowcount);

1027: from msc_phub_dates_mv
1028: where calendar_date between p_plan_start_date and p_plan_cutoff_date
1029: and calendar_date in (mfg_week_end_date, fis_period_end_date, month_end_date, p_plan_cutoff_date);
1030:
1031: log('msc_phub_util.get_reporting_dates, l_qid_last_date='||l_qid_last_date||', count='||sql%rowcount);
1032: commit;
1033:
1034: return l_qid_last_date;
1035: end get_reporting_dates;

Line 1076: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table||'('||l_partition_name||')');

1072: l_schema, p_table,
1073: partname=>l_partition_name,
1074: granularity=>'PARTITION',
1075: percent =>10);
1076: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table||'('||l_partition_name||')');
1077: else
1078: fnd_stats.gather_table_stats(l_schema, p_table,
1079: granularity=>'AUTO');
1080: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table);

Line 1080: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table);

1076: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table||'('||l_partition_name||')');
1077: else
1078: fnd_stats.gather_table_stats(l_schema, p_table,
1079: granularity=>'AUTO');
1080: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table);
1081: end if;
1082: else
1083: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table||
1084: ' skipped('||p_table_type||'='||l_profile_value||')');

Line 1083: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table||

1079: granularity=>'AUTO');
1080: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table);
1081: end if;
1082: else
1083: log('msc_phub_util.gather_table_stats: '||l_schema||'.'||p_table||
1084: ' skipped('||p_table_type||'='||l_profile_value||')');
1085: end if;
1086:
1087: end gather_table_stats;

Line 1113: log('msc_phub_util.unusuable_local_index:'||sqlerrm);

1109: log(l_ddl);
1110: execute immediate l_ddl;
1111: exception
1112: when others then
1113: log('msc_phub_util.unusuable_local_index:'||sqlerrm);
1114: end;
1115: end loop;
1116: end unusuable_local_index;
1117:

Line 1127: log('msc_phub_util.truncate_table('||p_table||')');

1123: dummy1 varchar2(50);
1124: dummy2 varchar2(50);
1125: e_truncate_tale exception;
1126: begin
1127: log('msc_phub_util.truncate_table('||p_table||')');
1128: if (fnd_installation.get_app_info('FND', dummy1, dummy2, l_applsys_schema) = false) then
1129: log(fnd_message.get_string('MSC', 'MSC_PART_UNDEFINED_SCHEMA'));
1130: raise e_truncate_tale;
1131: end if;

Line 1139: log('msc_phub_util.truncate_table: '||sqlerrm);

1135: commit;
1136:
1137: exception
1138: when others then
1139: log('msc_phub_util.truncate_table: '||sqlerrm);
1140: raise;
1141: end truncate_table;
1142:
1143: END msc_phub_util;

Line 1143: END msc_phub_util;

1139: log('msc_phub_util.truncate_table: '||sqlerrm);
1140: raise;
1141: end truncate_table;
1142:
1143: END msc_phub_util;