73 - Useful SQL Queries in Word

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 43
At a glance
Powered by AI
The document contains many SQL queries being run against various tables in the FUSION schema to retrieve product, BOM, routing and other manufacturing related data.

The queries are selecting data from tables related to items, BOMs, routings, locations, parameters and other master data tables.

Frequently referenced tables include MSC_SYSTEM_ITEMS, MSC_BOMS, MSC_BOM_COMPONENTS, MSC_WORK_DEFINITIONS and tables starting with MSC_ST_

select ENTITY, TABLE_NAME, TABLE_TYPE from msc_cc_entity_table_map where table_type='O' order by entity;

Select * from fusion.msc_cc_entity_table_map where table_type = 'S' and entity like 'W%';
select * from msc_xref_mapping where attribute_name='ITEM_NAME' and entity_name='ITEM' and
source_value<>target_value and source_value like 'AK-CRSRE%'; --AK-LFS-CRSREF, AK-CRSREF-CP
SELECT xref.orig_system_reference sourcesystemcustomernumber, hp.PARTY_NUMBER msc_customersvpartner_number,
cust.tp_id MSCcustid FROM fusion.HZ_PARTIES hp, fusion.HZ_ORIG_SYS_REFERENCES xref, fusion.msc_customers_v
cust where hp.party_id=xref.owner_table_id and xref.owner_table_name='HZ_PARTIES' and xref.orig_system='LEG'
and cust.partner_number=hp.party_number;
select * from FUSION.MSC_PLANNERS;

select * from FUSION.MSC_COLL_CYCLE_STATUS where REFRESH_NUMBER = '17495';


select * from FUSION_ORA_ESS.request_property where name='RefreshNumber' and value in ('17495');
select * from fusion.msc_cc_modified_entities where last_cycle_id = '17495';
select item_number,organization_id from fusion.egp_system_items_b where length (item_number) = 31 and
organization_id in (207,209);
select * from FUSION.MLOG$_EGP_SYSTEM_ITEMS_B where DMLTYPE$$='I';
SELECT requestid, parentrequestid, to_char(processstart-7/24, 'DD-MON-YYYY HH24:MI:SS') processstart,
to_char(processend-7/24, 'DD-MON-YYYY HH24:MI:SS') processend, executable_status, definition,
error_warning_message, errortype, redirectedoutputfile FROM
FUSION_ORA_ESS.REQUEST_HISTORY START WITH requestid = 369877 CONNECT BY PRIOR requestid = parentrequestid
order by requestid;

--ORGANIZATIONS/ITEMS
select * from FUSION.MSC_APPS_INSTANCES where INSTANCE_CODE like 'L%';
select DESCRIPTION, ORGANIZATION_ID,organization_code, sr_organization_id, enabled_flag from
MSC_INSTANCE_ORGS where organization_code like 'ASW';
select SR_INSTANCE_ID, ORGANIZATION_CODE, ORGANIZATION_ID, FULFILLMENT_INSTANCE_FLAG, ENABLED_FLAG from
MSC_INSTANCE_ORGS where SR_INSTANCE_ID = '100000011825006'; --organization_code like '%WAB';
select * from MSC_PARAMETERS where organization_code like 'M1%';
select * from FUSION.MSC_SUB_INVENTORIES where plan_id = '-1' and organization_id = '10165';
select a.calendar_code, a.organization_id, a.organization_code, a.plant_flag, a.PAST_DUE_SUPPLY_DAYS, a.*
from FUSION.MSC_PARAMETERS a where organization_code in ('ASW','CAW','NYW','TKW');
select a.error_text, a.* from msc_parameters where organization_name like 'TEST%';
select * from FUSION.MSC_LOCATION_ASSOCIATIONS where refresh_number = '19921';
select a.error_text, a.* from FUSION.MSC_ST_LOCATION_ASSOCIATIONS a where refresh_number = '19921';

select * from FUSION.MSC_LOCATIONS where location_code like '19222%';


select * from FUSION.MSC_ST_LOCATIONS where location_code like 'Locatio%';
select * from hr_locations where location_code like 'TEST-INT%';
select * from fusion.msc_ap_internal_locations_v where address1 like 'A1%';
select * from MSC_AP_ORG_LOC_ASSOCIATIONS_V where location_code = '300100104617651';
select * from FUSION.MSC_DEPARTMENT_RESOURCES where plan_id = -1 and ORGANIZATION_ID = 10063;

select * from MSC_INSTANCE_ORGS where SR_INSTANCE_ID = '100010026240311';


select a.item_number, a.* from FUSION.EGP_SYSTEM_ITEMS a where item_number like 'AKSP-LAPTOP%';
select a.ORGANIZATION_CODE, a.item_number, a.DESCRIPTION, a.MRP_PLANNING_CODE, a.PLANNER_CODE,
a.LIST_PRICE_PER_UNIT from FUSION.MSC_AP_EGP_SYSTEM_ITEMS_V a where item_number like 'AK-TEST-FG%';
select * from FUSION.MSC_SYSTEM_ITEMS where plan_id =-1 and item_name like 'AKSP-%' and organization_id =
10041;
desc fusion.msc_system_items;
select * from FUSION.MSC_SYSTEM_ITEMS where plan_id =-1 and organization_id in (select organization_id from
MSC_INSTANCE_ORGS where SR_INSTANCE_ID = '100000011825006');-- item_name like 'AK-TEST%';
select * from FUSION.MSC_ST_SYSTEM_ITEMS where refresh_number = '33995';
select * from FUSION.MSC_ST_SYSTEM_ITEMS where item_name like 'AK-CTO%';
select * from FUSION.EGP_ITEM_RELATIONSHIPS_VL;
select * from FUSION.MSC_INT_LOCATIONS_V where location_code = '1111';
select a.calendar_code, a.* from FUSION.MSC_PARAMETERS a where organization_id = 209;

--CALENDARS
select * from FUSION.MSC_CALENDAR_SHIFTS WHERE CALENDAR_CODE = '10002';
select * from fusion.msc_calendars
where calendar_code in (10002,10018);
select * from FUSION.MSC_CALENDARS where CALENDAR_CODE = '13022';
select * from FUSION.MSC_ST_CALENDARS where refresh_number = '19616';

select * from FUSION.MSC_CALENDAR_SHIFTS where CALENDAR_CODE = '13022';


select * from FUSION.MSC_CALENDAR_SHIFTS where refresh_number = '18015';
select * from FUSION.MSC_ST_CALENDAR_SHIFTS where refresh_number = '29499';

select * from FUSION.MSC_CALENDAR_DATES where CALENDAR_CODE = '13022';


select * from FUSION.MSC_CALENDAR_DATES where refresh_number = '19077';
select * from FUSION.MSC_ST_CALENDAR_DATES where refresh_number = '19616';

select * from FUSION.MSC_CAL_WEEK_START_DATES where CALENDAR_CODE = '13022';


select * from FUSION.MSC_CAL_WEEK_START_DATES where refresh_number = '18015';
select * from FUSION.MSC_ST_CAL_WEEK_START_DATES where refresh_number = '19616';

select * from FUSION.MSC_CALENDAR_EXCEPTIONS where CALENDAR_CODE = '13022';


select * from FUSION.MSC_ST_CALENDAR_EXCEPTIONS where refresh_number = '23838';
select * from FUSION.MSC_WORKDAY_PATTERNS where CALENDAR_CODE = '13022';
select * from FUSION.MSC_WORKDAY_PATTERNS where refresh_number = '19487';
select * from FUSION.MSC_ST_WORKDAY_PATTERNS where refresh_number = '19487';

select * from FUSION.MSC_PERIOD_START_DATES where CALENDAR_CODE = '13022';


select * from FUSION.MSC_ST_PERIOD_START_DATES where refresh_number = '32594';

--CALENDAR ASSIGNMENTS
select * from FUSION.MSC_CUSTOMERS_V where partner_number = 'CDRM_68076';
select * from FUSION.MSC_CUSTOMERS_V where partner_name like 'Computer Service and Rentals%';
select * from FUSION.MSC_CUSTOMER_SITES_V where partner_id = '1006';
select * from DOO_FULFILL_LINES_ALL;
select * from FUSION.MSC_GLOBAL_TRADING_PARTNERS where partner_type = '4' and partner_name like 'RT-%';
select * from FUSION.MSC_CALENDAR_ASSIGNMENTS where refresh_number = '19793';
select * from FUSION.MSC_CALENDAR_ASSIGNMENTS where calendar_code = '180';
select a.association_type, a.error_text, a.* from FUSION.MSC_ST_CALENDAR_ASSIGNMENTS a where refresh_number =
'30799';
select a.association_type, a.error_text, a.* from FUSION.MSC_ST_CALENDAR_ASSIGNMENTS a where refresh_number =
'19793';

--CURRENCIES FUSION/CSV
select * from MSC_AP_CURRENCIES_B_V where CURRENCY_CODE = 'ARU';
select * from MSC_AP_CURRENCIES_TL_V where CURRENCY_CODE = 'ARU';
select * from FUSION.MSC_CURRENCIES_B where CURRENCY_CODE in ('CUR1', 'CUR2', 'CUR3');
select * from FUSION.MSC_CURRENCIES_TL where CURRENCY_CODE in ('CUR1', 'CUR2', 'CUR3');
select * from FUSION.MSC_ST_CURRENCIES_B where refresh_number = '18584';
select * from FUSION.MSC_ST_CURRENCIES_TL where refresh_number = '18584';
select * from FUSION.MSC_ST_CURRENCIES_W where refresh_number = '18583';
select * from FUSION.MSC_XREF_MAPPING where ENTITY_NAME = 'CURRENCIES' and refresh_number = '18572';
select * from FND_LANGUAGES_B where LANGUAGE_CODE like 'K%';

--COLLECTION
-- TO FIND WHAT COLLECTION WAS RAN
Select * from fusion.msc_coll_cycle_status order by refresh_number desc;
--CURRENCY CONVERSION TYPE
select * from FUSION.MSC_CURRENCY_CONV_TYPES where CONVERSION_TYPE like 'Corp_Con%';
select * from FUSION.MSC_ST_CURRENCY_CONV_TYPES where refresh_number = '18590';
select * from FUSION.MSC_XREF_MAPPING where refresh_number = '18586';

--CURRENCY CONVERSION RATE


select * from FUSION.MSC_CURRENCY_CONVERSIONS where conversion_type like 'Corp_Conv%';
select * from FUSION.MSC_ST_CURRENCY_CONVERSIONS where refresh_number = '23998';

--UOM CODES
select * from FUSION.MSC_SYSTEM_ITEMS where part_key1 = '100010026240311';
select * from FUSION.MSC_UNITS_OF_MEASURE where uom_class = 'HGT';
select * from FUSION.MSC_ST_UNITS_OF_MEASURE where uom_code = 'HGT';
select a.error_text, a.* from FUSION.MSC_ST_UNITS_OF_MEASURE a where refresh_number = '19021';

--UOM CLASS CONVERSIONS


select * from FUSION.MSC_UOM_CLASS_CONVERSIONS where to_uom_class = 'HGT';
select a.error_text, a.* from FUSION.MSC_ST_UOM_CLASS_CONVERSIONS a where refresh_number = '20009';

--UOM CONVERSIONS
select * from FUSION.MSC_UOM_CONVERSIONS where uom_class = 'HGT';
select a.error_text, a.* from FUSION.MSC_ST_UOM_CONVERSIONS a where refresh_number = '20009';

--SUPPLIERS
select * from msc_global_trading_partners where partner_type = '1' and refresh_number = '19093' and
partner_name like 'LEG-%';
select * from msc_global_trading_partners where partner_type = '1' and partner_name like 'LEG-%';
select * from msc_global_trading_partners where partner_type = '1' and partner_name like 'ARU%';
select * from msc_st_global_trading_partners where partner_type = '1' and refresh_number = '17621' and
partner_name like '%';
select * from msc_st_global_trading_partners where partner_type = '1' and refresh_number = '19788';
select * from FUSION.MSC_AP_SUPPLIERS_V where sr_tp_id = 147; --partner_name like 'CV%'; --AK-SUPPL
select * from poz_suppliers poz where vendor_id = '300100044990738';
select * from poz_suppliers poz where enabled_flag = 'Y';

SELECT PARTNER_NAME,PARTNER_TYPE,STATUS,PARTNER_NUMBER FROM MSC_GLOBAL_TRADING_PARTNERS WHERE PARTNER_TYPE =


1 and refresh_number=&refresh_var order by partner_name;

-- SUPPLIER SITES
select * from MSC_TRADING_PARTNER_SITES where refresh_number = '19093' and partner_name like 'LEG-A%';
select * from MSC_TRADING_PARTNER_SITES where partner_name like 'CV_Supp%' order by partner_name;
select a.error_text, a.* from MSC_ST_TRADING_PARTNER_SITES a where refresh_number = '19788'; -- and
partner_name like 'LEG-%';
select a.error_text, a.* from MSC_ST_TRADING_PARTNER_SITES a where partner_name like 'ARU%' and
refresh_number = '17621';
select * from FUSION.MSC_AP_SUPPLIER_SITES_V where partner_name like 'ARU%';

-- XREF MAPPING TABLE FOR SOURCE - TARGET VALUES OF SITE IDS


select * from MSC_XREF_MAPPING where TARGET_VALUE='807000' and ENTITY_NAME='SUPPLIER_SITES';
select * from MSC_XREF_MAPPING where TARGET_VALUE='349239' and ENTITY_NAME='SUPPLIER_SITES';
select * from MSC_XREF_MAPPING where ENTITY_NAME='SUPPLIERS' and TARGET_VALUE in (select tp_id from
msc_global_trading_partners where partner_type = '1' and partner_name like 'LEG-%');
select * from MSC_XREF_MAPPING where ENTITY_NAME='SUPPLIER_SITES' and TARGET_VALUE in (select partner_site_id
from msc_trading_partner_sites where partner_name like 'LEG-%');
select * from MSC_XREF_MAPPING where refresh_number = '28820';

-- LOCATIONS FOR SUPPLIER SITES


select * from FUSION.MSC_LOCATIONS_V where country_code = 'US'; --location_code = '964';
select * from FUSION.MSC_LOCATIONS_TCA_V where location_id = '12345678';
select * from FUSION.MSC_LOCATION_ASSOCIATIONS where site_id = '807005';
select * from FUSION.MSC_LOC_ASSOCIATIONS_V where site_id = '281352';
select * from FUSION.MSC_ST_LOCATION_ASSOCIATIONS where refresh_number = '18495';
select * from FUSION.MSC_LOCATION_ASSOCIATIONS where refresh_number = '18548';

-- GOP SUPPLY UPDATE RULES


select * from FUSION.MSC_SUPPLY_UPDATE_ASSIGNMENTS where refresh_number = '23837';
select a.error_text, a.* from FUSION.MSC_ST_SUP_UPDATE_ASSIGNMENTS a where refresh_number = '23837';

select * from FUSION.MSC_CATALOG_CATEGORIES where category_name like 'Assem%';


select * from FUSION.MSC_ITEM_CATEGORIES where category_id in (select category_id from
FUSION.MSC_CATALOG_CATEGORIES where category_set_id = '10022') and organization_id = '606';
select * from FUSION.MSC_ITEM_CATEGORIES where inventory_item_id in (select inventory_item_id from
FUSION.MSC_SYSTEM_ITEMS where ITEM_NAME LIKE 'AK-TEST-CP%');
select * from FUSION.MSC_SYSTEM_ITEMS where ITEM_NAME LIKE 'AK-TEST-CP%';
select * from FUSION.MSC_ITEM_CATEGORIES where inventory_item_id = '731765';
select * from FUSION.MSC_CATEGORY_SETS where Category_Set_name like 'Planning Ite%';
select * from FUSION.MSC_CATALOG_CATEGORIES where Category_Set_ID = '10166';
select * from FUSION.MSC_CATEGORY_SETS_V where Category_Set_name like 'Prod%';
select * from FUSION.MSC_ITEM_CATEGORIES where inventory_item_id = '733072';
select * from FUSION.MSC_CATALOG_CATEGORIES where category_id in (select category_id from
FUSION.MSC_ITEM_CATEGORIES where inventory_item_id = '10460');
select profile_option_value from FND_PROFILE_OPTION_VALUES where profile_option_id in (select
profile_option_id from FND_PROFILE_OPTIONS_VL where
PROFILE_OPTION_NAME like 'MSC_SRC_ASSIGNMENT_CATALOG%');
select * from MSC_AP_CATEGORY_SETS_V;

-- GOP PLANNING ALLOCATION RULES


select * from FUSION.MSC_ALLOCATIONS where refresh_number = '18752';
select * from FUSION.MSC_ALLOC_RULE_TIME_PHASES where ALLOCATION_RULE_ID in ( select allocation_rule_id from
FUSION.MSC_ALLOCATION_RULES where refresh_number = '18752');
select * from FUSION.MSC_ALLOCATION_RULES where refresh_number = '18752';
select a.error_text, a.* from FUSION.MSC_ST_ALLOCATION_RULES a where refresh_number = '18752';
select a.category_id, a.allocation_rule_id, a.* from FUSION.MSC_ALLOCATION_ASSIGNMENTS a where
ALLOCATION_RULE_ID in (select allocation_rule_id from FUSION.MSC_ALLOCATION_RULES where refresh_number =
'18752');
select a.error_text, a.* from FUSION.MSC_ST_ALLOC_ASSIGNMENTS a where refresh_number = '18752';
select * from MSC_AP_EGP_SYSTEM_ITEMS_V where item_number like 'AK-TEST-%';
select * from MSC_ALLOCATION_ASSIGNMENTS where allocation_rule_id in (select allocation_rule_id from
FUSION.MSC_ALLOCATION_RULES where refresh_number = '19908');

--DEMAND CLASSES
select * from fusion.msc_ap_fnd_lookup_values_tl where entity_name = 'DEMAND_CLASS';
select * from msc_sr_lookup_values_vl where lookup_type = 'DEMAND_CLASS';
select * from MSC_ST_SR_LOOKUP_VALUES_B where refresh_number = '23482';
select * from msc_xref_mapping where target_value = '3333';

select * from MSC_ST_SR_LOOKUP_VALUES_TL where refresh_number = '23482';


select * from MSC_XREF_MAPPING where entity_name = 'DEMAND_CLASS' and sr_instance_id = '100010026240311';

select * from MSC_ST_SR_LOOKUP_VALUES_W where refresh_number = '23482';


select * from MSC_SR_LOOKUP_VALUES_B where refresh_number = '23482';
select * from MSC_SR_LOOKUP_VALUES_TL where lookup_type like 'DEMAND_CLASS%' and refresh_number = '23482';

select language_code from FUSION.fnd_languages where installed_flag in ('B','I');


select * from FUSION.MSC_AP_FND_LOOKUP_VALUES_B_V where lookup_type like 'DEMAND%';

-- ATP RULES & ASSIGNMENTS


select * from FUSION.MSC_ATP_RULES where refresh_number = '23957';
select * from FUSION.MSC_ATP_RULES where rule_name like 'LEG-AK%';
select * from FUSION.MSC_ATP_RULES where refresh_number = '33355';
select * from FUSION.MSC_ST_ATP_RULES where refresh_number = '23957';
select a.inventory_item_id, a.CATEGORY_ID, a.atp_rule_id, a.category_name, a.* from
FUSION.MSC_ATP_ASSIGNMENTS a where refresh_number = '18608';
select a.CATEGORY_ID, a.atp_rule_id, a.category_name, a.* from FUSION.MSC_ATP_ASSIGNMENTS a where
ATP_RULE_ID = '100100145255925';
select a.ORGANIZATION_ID, a.atp_rule_id, a.category_name, a.* from FUSION.MSC_ATP_ASSIGNMENTS a where
a.ORGANIZATION_ID = '10165'; --refresh_number = '23957';

select * from FUSION.MSC_ST_ATP_ASSIGNMENTS where refresh_number = '18618';

select * from FUSION.MSC_ATP_ASSIGNMENTS where atp_rule_id in (select rule_id from FUSION.MSC_ATP_RULES where
refresh_number = '35084');
select * from FUSION.MSC_ATP_ASSIGNMENTS where atp_rule_id = '100100145255945';
select * from FUSION.MSC_ATP_RULES where rule_id in (select atp_rule_id from FUSION.MSC_ATP_ASSIGNMENTS)
where inventory_item_id = '724826');
select * from FUSION.MSC_ATP_RULES where rule_id = '100100142492197';
select a.* from FUSION.MSC_SYSTEM_ITEMS a where ITEM_NAME like 'AK-PIM';

-- APPROVED SUPPLIER LISTS


select * from FUSION.MSC_ITEM_SUPPLIERS where refresh_number = '18938';
select a.ERROR_TEXT, a.* from MSC_ST_ITEM_SUPPLIERS a where refresh_number = '18937';
select * from FUSION.MSC_ITEM_SUPPLIERS where plan_id = -1 and inventory_item_id in (select inventory_item_id
from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AK-%');
select * from msc_item_suppliers where refresh_number = 32705;
select a.error_text, a.item_name, a.vendor_name, a.VENDOR_SITE_CODE,a.* from msc_st_item_suppliers a where
refresh_number = '17621' and error_text is not null and item_name like 'AK%';

select a.purchasing_unit_of_measure, a.* from FUSION.MSC_ITEM_SUPPLIERS a where inventory_item_id like


'726879%' and plan_id = -1; --26520
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'LFS%';
select ASL_ID, SUPPLIER_ID, SUPPLIER_SITE_ID, INVENTORY_ITEM_ID, DELIVERY_CALENDAR_CODE, PROCESSING_LEAD_TIME
from FUSION.MSC_ITEM_SUPPLIERS where refresh_number = '17727';
select * from FUSION.MSC_AP_EGP_SYSTEM_ITEMS_V where item_number like 'AK-DSHIP%';
select * from FUSION.MSC_AP_PO_SUPPLIERS_V where item_name like 'AK-%';
select a.unit_price, a.* from po_lines_all a where item_id = '300100051296435';
select a.primary_vendor_item, a.item_id, a.vendor_id, a.vendor_site_id, a.disable_flag, a.asl_status_id, a.*
from PO_APPROVED_SUPPLIER_LIST a where item_id = '300100036926531';
select a.unit_price, a.* from po_lines_all a where item_id = '300100051286276';

select * from PO_ASL_ATTRIBUTES;


select * from FUSION.MSC_ITEM_SUPPLIERS where inventory_item_id = '726560' and plan_id = -1;

-- SUPPLIER CAPACITY
select * from FUSION.MSC_SUPPLIER_CAPACITIES where plan_id = -1 and refresh_number = '18450';
select a.error_text, a.* from FUSION.MSC_ST_SUPPLIER_CAPACITIES a where refresh_number = '18450';

Select * FROM MSC_SUPPLIER_CAPACITIES where plan_id= '-1' and inventory_item_id in(select distinct
inventory_item_id from fusion.msc_system_items where item_name Like 'BJ-DIAL-F%');
Select * from MSC_SUPPLIER_CAPACITIES where plan_id= '-1' and inventory_item_id in ('732227');
select * from FUSION.MSC_SYSTEM_ITEMS where item_name in ('AK-TEST-PR', 'AK-TEST-CP', 'AK-COLLS-BATTERY');

-- INTERLOCATION SHIPPING METHODS


select * from FUSION.MSC_INTERORG_SHIP_METHODS where refresh_number = '21427';
select * from FUSION.MSC_ST_INTERORG_SHIP_METHODS where refresh_number = '19310';
select * from FUSION.MSC_INTERORG_SHIP_METHODS where origin_id = '10002';
select * from fusion.msc_interorg_ship_methods where carrier_id is null;
select a.error_text, a.origin_type, a.origin_code, a.DESTINATION_TYPE, a.DESTINATION_CODE, a.* from
FUSION.MSC_ST_INTERORG_SHIP_METHODS a where refresh_number = '19310';
SELECT * FROM MSC_SR_LOOKUP_VALUES_VL MOTODS where
motods.LOOKUP_TYPE(+) = 'WSH_MODE_OF_TRANSPORT';
SELECT * FROM MSC_SR_LOOKUP_VALUES_VL MOTODS where
motods.LOOKUP_TYPE(+) = 'WSH_SERVICE_LEVELS';
select * from MSC_GLOBAL_TRADING_PARTNERS where partner_type = '4';
select * from MSC_UNITS_OF_MEASURE where UOM_CLASS = 'Time';
select * from FUSION.MSC_REGIONS_V where country_code = 'US';
select * from FUSION.MSC_ZONES_V where country_code = 'US';
select * from FUSION.MSC_LOCATIONS_V where country_code = 'US';
select * from MSC_INSTANCE_ORGS where sr_instance_id like '%311';
select SR_INSTANCE_ID, ORGANIZATION_ID, ORGANIZATION_CODE from MSC_INSTANCE_ORGS where SR_INSTANCE_ID =
'100010026240311' and organization_code like 'M%';
select * from MSC_AP_INTERORG_SHIP_METHODS_V where from_organization_code = 'M3';
select * from WSH_TRANSIT_TIMES;
select * from FUSION.MSC_INTERORG_SHIP_METHODS where origin_id = '10025';
select * from MSC_ST_GLOBAL_TRADING_PARTNERS where partner_type = 4 and error_text is not null;
Select * from fusion.msc_st_global_trading_partners order by creation_date desc;
select * from fusion.msc_xref_mapping where entity_name = 'CARRIERS' and source_value = 'DHL' and
sr_instance_id = '100010026240311';
Select * from fusion.msc_global_trading_partners where partner_name = 'DHL';

-- PURCHASE ORDERS
select a.error_text,a.order_number,a.item_name,a.* from msc_st_supplies a where refresh_number='23815';
select a.ORDER_NUMBER, a.refresh_number, a.SUBINVENTORY_CODE,a.* from msc_supplies a where ORDER_TYPE = '1'
and refresh_number = '18690';
select a.ORDER_NUMBER, a.refresh_number, a.* from msc_supplies a where ORDER_TYPE = '1' and part_key1 =
'100000011825006';
select
DELIVERY_PRICE,DELETED_FLAG,error_text,order_number,NEW_ORDER_QUANTITY,NEW_DOCK_DATE,NEW_SCHEDULE_DATE,PROMIS
ED_DATE,ORIGINAL_NEED_BY_DATE,NEED_BY_DATE, order_type from msc_st_supplies where REFRESH_NUMBER=18025;
select a.INVENTORY_ITEM_ID, a.ORGANIZATION_ID, a.part_key1, a.supplier_id, a.order_type, a.firm_planned_type,
a.supplier_site_id, a.purch_line_num, a.order_number, a.revision, a.new_order_quantity, a.bmt_flag,
a.requested_ship_date, a.promised_ship_date, a.carrier_id, a.mode_of_transport, a.service_level,
a.ship_method, a.DROP_SHIP_DEST_TYPE, a.DROP_SHIP_CUST_ID, a.DROP_SHIP_CUST_SITE_ID, a.schedule_line_num,
a.delivery_price, a.need_by_date, a.subinventory_code from msc_supplies a where refresh_number = '22558';
select * from FUSION.MSC_SUPPLIES where part_key1 = '100010026240311' and order_type = 1; --refresh_number =
'21994';
select * from FUSION.MSC_SYSTEM_ITEMS where item_name= 'LFS-PR';
select * from FUSION.MSC_SUPPLIES where plan_id = -1 and order_type = '18' and inventory_item_id = '727598';
select * from FUSION.MSC_CUSTOMERS_V where partner_number = '1006';
select * from FUSION.MSC_CUSTOMER_SITES_V where partner_id = '1006';
SELECT xref.orig_system_reference sourcesystemcustomernumber, hp.PARTY_NUMBER msc_customersvpartner_number,
cust.tp_id MSCcustid FROM fusion.HZ_PARTIES hp, fusion.HZ_ORIG_SYS_REFERENCES xref, fusion.msc_customers_v
cust where hp.party_id=xref.owner_table_id and xref.owner_table_name='HZ_PARTIES' and xref.orig_system='LEG'
and cust.partner_number=hp.party_number;

select * from FUSION.MSC_SUB_INVENTORIES where ORGANIZATION_ID = '10165'; -- 10165 --10283

-- PURCHASE REQUISITIONS
select * from FUSION.MSC_SUPPLIES where refresh_number = '19514';
select
INVENTORY_ITEM_ID,ORGANIZATION_ID,PART_KEY1,SUPPLIER_ID,ORDER_TYPE,FIRM_PLANNED_TYPE,SUPPLIER_SITE_ID,PURCH_L
INE_NUM,ORDER_NUMBER,REVISION,NEW_ORDER_QUANTITY,BMT_FLAG,REQUESTED_SHIP_DATE,PROMISED_SHIP_DATE,CARRIER_ID,M
ODE_OF_TRANSPORT,SERVICE_LEVEL,SHIP_METHOD,DROP_SHIP_DEST_TYPE,DROP_SHIP_CUST_ID,DROP_SHIP_CUST_SITE_ID,SCHED
ULE_LINE_NUM,DELIVERY_PRICE,NEED_BY_DATE,PROMISED_DATE,NEW_SCHEDULE_DATE,SUBINVENTORY_CODE,ORIGINAL_NEED_BY_D
ATE from FUSION.MSC_SUPPLIES where ORDER_TYPE='2' and refresh_number = '23815';
select
INVENTORY_ITEM_ID,ORGANIZATION_ID,PART_KEY1,SUPPLIER_ID,ORDER_TYPE,FIRM_PLANNED_TYPE,SUPPLIER_SITE_ID,PURCH_L
INE_NUM,ORDER_NUMBER,REVISION,NEW_ORDER_QUANTITY,BMT_FLAG,REQUESTED_SHIP_DATE,PROMISED_SHIP_DATE,CARRIER_ID,M
ODE_OF_TRANSPORT,SERVICE_LEVEL,SHIP_METHOD,DROP_SHIP_DEST_TYPE,DROP_SHIP_CUST_ID,DROP_SHIP_CUST_SITE_ID,SCHED
ULE_LINE_NUM,DELIVERY_PRICE,NEED_BY_DATE,PROMISED_DATE,NEW_SCHEDULE_DATE,SUBINVENTORY_CODE,ORIGINAL_NEED_BY_D
ATE from FUSION.MSC_SUPPLIES where ORDER_TYPE in ('1','2') and part_key1 = '100000011825006';
select error_text,order_number,DELETED_FLAG from msc_st_supplies where refresh_number = '19536';
select * from FUSION.MSC_SUPPLIES where ORDER_TYPE='2' and part_key1 = '100000011825006';

-- INTRANSITS
select * from FUSION.MSC_SUPPLIES where order_type in (8,11) and part_key1 = '100000011825006';
select * from FUSION.MSC_SUPPLIES where refresh_number = '23815' and order_type in (8,11);
select a.ERROR_TEXT,a.ORDER_NUMBER, a.* from FUSION.MSC_ST_SUPPLIES a where order_type in (8,11) and
refresh_number = '23717';
select
INVENTORY_ITEM_ID,ORGANIZATION_ID,PART_KEY1,SUPPLIER_ID,ORDER_TYPE,FIRM_PLANNED_TYPE,SUPPLIER_SITE_ID,PURCH_L
INE_NUM,ORDER_NUMBER,REVISION,NEW_ORDER_QUANTITY,BMT_FLAG,REQUESTED_SHIP_DATE,PROMISED_SHIP_DATE,CARRIER_ID,M
ODE_OF_TRANSPORT,SERVICE_LEVEL,SHIP_METHOD,DROP_SHIP_DEST_TYPE,DROP_SHIP_CUST_ID,DROP_SHIP_CUST_SITE_ID,SCHED
ULE_LINE_NUM,DELIVERY_PRICE,NEED_BY_DATE,PROMISED_DATE,NEW_SCHEDULE_DATE,SUBINVENTORY_CODE,ORIGINAL_NEED_BY_D
ATE from FUSION.MSC_SUPPLIES where ORDER_TYPE in ('8','11') and part_key1 = '100000011825006';

select a.ORDER_NUMBER, a.refresh_number, a.* from msc_supplies a where ORDER_NUMBER like 'LFS%';
select * from FUSION.MSC_SYSTEM_ITEMS where ITEM_NAME like 'AK-CTO-%';

-- TRANSFER ORDERS
select * from FUSION.MSC_SUPPLIES where order_type = '94' and refresh_number = '22017';
select error_text, item_name,organization_id, source_organization_id, SOURCE_SUBINVENTORY_CODE,
subinventory_code, new_order_quantity, to_line_number, inventory_item_id, order_number, firm_planned_type,
new_schedule_date, need_by_date, new_ship_date, new_dock_date, carrier_id, MODE_OF_TRANSPORT, SERVICE_LEVEL,
ship_method, order_type, refresh_number, interface_status_lookup, DELETED_FLAG from FUSION.MSC_ST_SUPPLIES
where order_type = '94' and refresh_number = '22017' and error_text is not null;
select transaction_id, part_key1, organization_id, source_organization_id, SOURCE_SUBINVENTORY_CODE,
subinventory_code, new_order_quantity, to_line_number, inventory_item_id, order_number, firm_planned_type,
new_schedule_date, need_by_date, new_ship_date, new_dock_date, carrier_id, MODE_OF_TRANSPORT, SERVICE_LEVEL,
ship_method, order_type, fg_order_type, refresh_number, interface_status_lookup from FUSION.MSC_SUPPLIES
where refresh_number = '22017';
select transaction_id, part_key1, organization_id, source_organization_id, SOURCE_SUBINVENTORY_CODE,
subinventory_code, new_order_quantity, to_line_number, inventory_item_id, order_number, firm_planned_type,
new_schedule_date, need_by_date, new_ship_date, new_dock_date, carrier_id, MODE_OF_TRANSPORT, SERVICE_LEVEL,
ship_method, order_type, refresh_number, interface_status_lookup from FUSION.MSC_SUPPLIES where order_type =
'94' and refresh_number = '18533';

-- FUSION SOURCE COLLECTION


select * from FUSION.MSC_AP_TRANSFER_ORDERS_V where FROM_ORGANIZATION_CODE = 'M1' and ORGANIZATION_CODE =
'V1' and ORDER_NUMBER = '1022';

-- FUSION SOURCE - PO
select a.SUBINVENTORY_CODE, a.ORDER_NUMBER, a.ITEM_NAME, a.NEW_ORDER_QUANTITY, a.* from
FUSION.MSC_AP_PO_PO_SUPPLY_V a where item_name like 'AK-COLLS%' order by a.ORDER_NUMBER;
select a.ORDER_NUMBER, a.ITEM_NAME, a.* from FUSION.MSC_AP_PO_PO_SUPPLY_V a where order_number in
('1003320','1003322','1003323');
select a.SERVICE_LEVEL, a.MODE_OF_TRANSPORT, a.order_type, a.ORDER_NUMBER, a.ERROR_TEXT, a.* from
FUSION.MSC_ST_SUPPLIES a where refresh_number = '20870' and item_name = 'HCOP-Bolt';
select * from FUSION.MSC_SUB_INVENTORIES where organization_id in (207, 204, 229) and SUB_INVENTORY_CODE =
'RIP';
select * from FUSION.MSC_SUPPLIES where refresh_number = '20870';
select * from ALL_VIEWS where view_name = 'MSC_AP_PO_PO_SUPPLY_V';
select a.SUBINVENTORY_CODE, a.ORDER_NUMBER, a.* from FUSION.MSC_AP_PO_PO_SUPPLY_V a where order_number like
'1004033%';
select a.refresh_number, a.CARRIER_ID, a.SERVICE_LEVEL, a.MODE_OF_TRANSPORT, a.* from FUSION.MSC_SUPPLIES a
where ORDER_NUMBER like '1004061%';
select DOCUMENT_STATUS,SEGMENT1 from PO_HEADERS_ALL where SEGMENT1 like '1002958%';
select * from PO_LINES_ALL where ITEM_ID = '300100038291366';
select * from INV_SUPPLY where supply_type_code = 'PO' and created_by = 'CVBUYER01' and item_id =
'300100036090200' and TO_SUBINVENTORY IS NULL;
select * from FUSION.MSC_AP_PO_PO_SUPPLY_V where ITEM_NAME like 'HCOP%';
select * from FUSION.MSC_SYSTEM_ITEMS where ITEM_NAME = 'HCOP-Bolt';
select a.order_number, a.* from MSC_AP_PO_PO_SUPPLY_V a order by NEW_ORDER_PLACEMENT_DATE desc;

select * from FUSION.MSC_SUPPLIES where order_type in (1,11,8,2) and plan_id = -1 and inventory_item_id in
(731520);
select a.error_text, a.order_number, a.* from FUSION.MSC_ST_SUPPLIES a where order_number like '1003905%';

select a.error_text, a.organization_code, a.item_name, a.order_number, a.order_type,a.* from


FUSION.MSC_ST_SUPPLIES a where order_number = '1004381';
select a.order_number, a.order_type,a.promised_date, a.refresh_number,a.* from FUSION.MSC_SUPPLIES a where
order_number like '1003102%';
select * from FUSION.MSC_SUPPLIES where order_number like '1004909%' and order_type = '11';
select a.order_number, a.order_type, a.* from FUSION.MSC_SUPPLIES a where inventory_item_id = '727001' and
order_number like ('1004%');
select a.inventory_item_id, a.organization_id, a.order_number, a.order_type,a.promised_date,a.* from
FUSION.MSC_SUPPLIES a where refresh_number = '27833';
select * from fusion.msc_system_items where item_name = 'AK-DSHIP-BUY';

--FUSION SOURCE - PO INTRANSITS


select ORGANIZATION_ID, organization_code, sr_organization_id from MSC_INSTANCE_ORGS where sr_instance_id
like '%309' and ORGANIZATION_CODE like 'M%';
select * from FUSION.MSC_SYSTEM_ITEMS where organization_id in (207,606) order by item_name;
select * from FUSION.MSC_SUB_INVENTORIES where organization_id in (207,606) and SUB_INVENTORY_CODE like 'F%'
order by SUB_INVENTORY_CODE;
select * from FUSION.MSC_AP_PO_SHIP_SUPPLY_V where order_type = '11' and item_name like 'AK-COLLS-%';
select * from MSC_AP_PO_SHIP_SUPPLY_V where item_name like 'AK-COLLS%';
select s.ORDER_TYPE, s.ORDER_NUMBER, s.SUBINVENTORY_CODE, s.PURCH_LINE_NUM, s.PO_LINE_LOCATION_ID, s.* from
FUSION.MSC_SUPPLIES s where order_number like '1004033%';
select s.error_text, s.ORDER_TYPE, s.* from FUSION.MSC_ST_SUPPLIES s where refresh_number = '22353' and
order_type = '11' and Order_number like '1003962%';
select * from FUSION.MSC_SUB_INVENTORIES where SUB_INVENTORY_CODE = 'SLC_RCV';
select a.TO_SUBINVENTORY, a.* from INV_SUPPLY a where supply_type_code = 'SHIPMENT';
select TO_SUBINVENTORY,a.* from INV_SUPPLY a where item_id like '300100037716170';
select * from MSC_SYSTEM_ITEMS where item_name like '0VP-PIM3%';
select s.ORDER_TYPE, s.* from FUSION.MSC_SUPPLIES s where refresh_number = '22353' and order_type = '11' and
order_number like '%1003962%';

--FUSION SOURCE - PO IN RECEIVING


select * from FUSION.MSC_AP_PO_RCV_SUPPLY_V where order_number like '1004527%';
select * from FUSION.MSC_AP_PO_RCV_SUPPLY_V where item_name like 'AK-COLLS%';
select PLAN_ID,PURCH_LINE_NUM,
SCHEDULE_LINE_NUM,INVENTORY_ITEM_ID,ORGANIZATION_ID,PART_KEY1,SUPPLIER_ID,ORDER_TYPE,FIRM_PLANNED_TYPE,SUPPLI
ER_SITE_ID,PURCH_LINE_NUM,ORDER_NUMBER,REVISION,NEW_ORDER_QUANTITY,BMT_FLAG,REQUESTED_SHIP_DATE,PROMISED_SHIP
_DATE,CARRIER_ID,MODE_OF_TRANSPORT,SERVICE_LEVEL,SHIP_METHOD,DROP_SHIP_DEST_TYPE,DROP_SHIP_CUST_ID,DROP_SHIP_
CUST_SITE_ID,SCHEDULE_LINE_NUM,NEW_DOCK_DATE,DELIVERY_PRICE,QTY_SCRAPPED,NEED_BY_DATE,PROMISED_DATE,NEW_SCHED
ULE_DATE,SUBINVENTORY_CODE,ORIGINAL_QUANTITY,ORIGINAL_NEED_BY_DATE,NEW_ORDER_PLACEMENT_DATE,PO_DISTRIBUTION_I
D,PO_LINE_ID,PO_LINE_LOCATION_ID, REFRESH_NUMBER from FUSION.MSC_SUPPLIES where ORDER_TYPE='8' and
INVENTORY_ITEM_ID = '724826';
select a.error_text, a.* from fusion.msc_st_supplies a where order_type = '8' and refresh_number = '20503';

select * from rcv_transactions where po_line_id = '300100055330178';


select * from MSC_AP_ONHAND_SUPPLIES_V where inventory_item_id = '300100051286289';
--FUSION SOURCE - PURCHASE REQUISITION
select * from INV_SUPPLY where supply_type_code = 'REQ' and item_id like '30010003%';
select * from POR_REQUISITION_HEADERS_ALL;
select * from POR_REQUISITION_LINES_ALL where item_id = '300100036402947';
select * from FUSION.MSC_AP_PO_REQ_SUPPLY_V where item_name like 'AK-COLLS%' order by ORDER_NUMBER; --
order_number in (10503632,10503633,10503634,10503635,10503637);
select * from FUSION.MSC_AP_PO_REQ_SUPPLY_V where organization_id = '207' and item_name like 'AK-%'; --order
by item_name; --121 records
select
PO_LINE_ID,PO_HEADER_NUMBER,INVENTORY_ITEM_ID,ORGANIZATION_ID,PART_KEY1,SUPPLIER_ID,ORDER_TYPE,FIRM_PLANNED_T
YPE,SUPPLIER_SITE_ID,PURCH_LINE_NUM,ORDER_NUMBER,REVISION,NEW_ORDER_QUANTITY,BMT_FLAG,REQUESTED_SHIP_DATE,PRO
MISED_SHIP_DATE,CARRIER_ID,MODE_OF_TRANSPORT,SERVICE_LEVEL,SHIP_METHOD,DROP_SHIP_DEST_TYPE,DROP_SHIP_CUST_ID,
DROP_SHIP_CUST_SITE_ID,SCHEDULE_LINE_NUM,NEW_DOCK_DATE,DELIVERY_PRICE,QTY_SCRAPPED,NEED_BY_DATE,PROMISED_DATE
,NEW_SCHEDULE_DATE,SUBINVENTORY_CODE,ORIGINAL_QUANTITY,ORIGINAL_NEED_BY_DATE,NEW_ORDER_PLACEMENT_DATE from
FUSION.MSC_SUPPLIES where ORDER_TYPE='2' and order_number like '10503040%';
select
PO_LINE_ID,PO_HEADER_NUMBER,INVENTORY_ITEM_ID,ORGANIZATION_ID,PART_KEY1,SUPPLIER_ID,ORDER_TYPE,FIRM_PLANNED_T
YPE,SUPPLIER_SITE_ID,PURCH_LINE_NUM,ORDER_NUMBER,REVISION,NEW_ORDER_QUANTITY,BMT_FLAG,REQUESTED_SHIP_DATE,PRO
MISED_SHIP_DATE,CARRIER_ID,MODE_OF_TRANSPORT,SERVICE_LEVEL,SHIP_METHOD,DROP_SHIP_DEST_TYPE,DROP_SHIP_CUST_ID,
DROP_SHIP_CUST_SITE_ID,SCHEDULE_LINE_NUM,NEW_DOCK_DATE,DELIVERY_PRICE,QTY_SCRAPPED,NEED_BY_DATE,PROMISED_DATE
,NEW_SCHEDULE_DATE,SUBINVENTORY_CODE,ORIGINAL_QUANTITY,ORIGINAL_NEED_BY_DATE,NEW_ORDER_PLACEMENT_DATE from
FUSION.MSC_SUPPLIES where ORDER_TYPE='2' and order_number like 'PR1-PIM%';
select a.SUBINVENTORY_CODE, a.ORDER_NUMBER, ERROR_TEXT, a.* from FUSION.MSC_ST_SUPPLIES a where order_type =
'2' and refresh_number = '26035' and order_number like '1050346%';
select * from FUSION.MSC_AP_PO_REQ_SUPPLY_V WHERE ORDER_NUMBER IN (SELECT ORDER_NUMBER FROM
FUSION.MSC_SUPPLIES WHERE ORDER_TYPE = '2') AND ORDER_TYPE = '2';
SELECT a.schedule_line_num, a.po_line_id, a.purch_line_num, a.po_line_location_id, a.* FROM
FUSION.MSC_SUPPLIES a WHERE ORDER_TYPE = '2' and order_number like '10503771%';
select a.order_type, a.ORDER_NUMBER, ERROR_TEXT, a.* from fusion.msc_st_supplies a where refresh_number =
'22193' and order_number like '1050%' and error_text is not null and item_name like 'AK-PIM%';
select a.order_type, a.ORDER_NUMBER, ERROR_TEXT, a.* from fusion.msc_st_supplies a where refresh_number =
'22213' and order_type = '2';
select * from POR_REQUISITION_LINES_ALL where carrier_id is not null;

select * from po_headers_all where segment1='1002324';

--FUSION SOURCE TRANSFER ORDER


select * from fusion.dos_supply_headers_int where interface_batch_number ='MINMAX162731';
select * from fusion.dos_supply_LINES_int where interface_batch_number ='MINMAX162731';

select * from fusion.inv_supply where item_id = '300100061936509';


select * from fusion.inv_transfer_order_lines where inventory_item_id = '300100061936509';
select * from FUSION.MSC_AP_TRANSFER_ORDERS_V where item_name like 'RT-EBAS311%';

select PERSON_ID from fusion.per_users where username like 'WHSE_MGR_M2';


select PERSON_ID from fusion.pet r_users where username like 'WHSE_MGR_M2';

Select * from fusion.dos_supply_tracking_line_docs where header_id like 300100048155963;


select * from egp_system_items where item_number = 'RT-EBAS311';

select * from FUSION.MSC_AP_TRANSFER_ORDERS_V where item_name like 'SYD-%';

select * from fusion.rcv_shipment_headers where shipment_num = '2250828';

select * from FUSION.MSC_SUPPLIES where refresh_number = '19196';


select transaction_id, part_key1, organization_id, source_organization_id, SOURCE_SUBINVENTORY_CODE,
subinventory_code, new_order_quantity, to_line_number, inventory_item_id, order_number, firm_planned_type,
new_schedule_date, need_by_date, new_ship_date, new_dock_date, carrier_id, MODE_OF_TRANSPORT, SERVICE_LEVEL,
ship_method, order_type, refresh_number, interface_status_lookup from FUSION.MSC_SUPPLIES where order_type in
(94,11,8) and inventory_item_id = '12365' and order_number = 138001;
select transaction_id, part_key1, organization_id, source_organization_id, SOURCE_SUBINVENTORY_CODE,
subinventory_code, new_order_quantity, to_line_number, inventory_item_id, order_number, firm_planned_type,
new_schedule_date, need_by_date, new_ship_date, new_dock_date, carrier_id, MODE_OF_TRANSPORT, SERVICE_LEVEL,
ship_method, order_type, refresh_number, interface_status_lookup from FUSION.MSC_SUPPLIES where
refresh_number = '34454';
select a.error_text, a.* from FUSION.MSC_ST_SUPPLIES a where refresh_number = '18750' and error_text is not
null;

select * from msc_supplies where inventory_item_id = 237430 and order_type = 94 and refresh_number = 27407;
select * from fusion.egp_system_items where item_number like 'AK-COLLS-LAPTOP%';

--WORK AREA AND WORK CENTER


select * from FUSION.WIS_WORK_AREAS_VL where work_area_code like 'AK%';
select * from FUSION.WIS_WORK_CENTERS_VL where work_center_code like 'AK%';
select * from FUSION.WIS_WC_RESOURCES where work_center_id = '300100054306337';
select * from FUSION.MSC_AP_RESOURCES_V where resource_code like 'AK-COLLS-MA-RES1%';
select * from FUSION.MSC_DEPARTMENT_RESOURCES where resource_code like 'AKSP-%' and plan_id = -1;
select * from FUSION.MSC_DEPARTMENT_RESOURCES where organization_id = '207'; --resource_code like 'AK%';
select * from FUSION.MSC_DEPARTMENT_RESOURCES where organization_id in (207,209); where refresh_number =
'23315';

select * from FUSION.MSC_DEPARTMENT_RESOURCES where plan_id = -1 and refresh_number = '18430';

select * from fusion.MSC_AP_RESOURCE_AVL_V where organization_code='M1' and resource_code like


'JI_EquipShif_ResM1' order by from_time;
-- RESOURCE SHIFTS
select * from FUSION.MSC_DEPARTMENT_RESOURCES where ORGANIZATION_ID = '10020' and DEPARTMENT_ID = '10078';
select * from FUSION.MSC_DEPARTMENT_RESOURCES where RESOURCE_CODE like 'AKSP-%';
select * from FUSION.MSC_RESOURCE_SHIFTS where DEPARTMENT_ID = '300100054306337';
select a.error_text, a.* from FUSION.MSC_ST_RESOURCE_SHIFTS a where refresh_number = '30677';
select * from FUSION.MSC_DEPARTMENT_RESOURCES where UNIT_OF_MEASURE <> 'HRS';

select * from FUSION.MSC_ST_DEPARTMENT_RESOURCES where Refresh_number = 26260;


select * from FUSION.MSC_ST_DEPARTMENT_RESOURCES where Refresh_number = 26261;
select * from FUSION.MSC_DEPARTMENT_RESOURCES where Refresh_number = 26261;

-- RESOURCE AVAILABILTY/CAPACITY
select * from FUSION.RCS_RESOURCE_AVL_DTLS where work_center_id = '300100054306337';
select * from FUSION.MSC_AP_RESOURCE_AVL_V where department_code like 'AKSP%';

select * from FUSION.MSC_AVAILABLE_RES_HOURS where plan_id = '-1' and department_id = '300100079179222';


select * from FUSION.MSC_NET_RESOURCE_AVAIL where organization_id = '10041' and department_id =
'300100079179222';
select * from MSC_NET_RESOURCE_AVAIL where refresh_number=32814;
select a.error_text, a.* from FUSION.MSC_ST_NET_RESOURCE_AVAIL a where refresh_number = '32875';
select * from FUSION.MSC_ST_NET_RESOURCE_AVAIL where refresh_number = '30201';

-- ROUTINGS
-- WORK DEFINITIONS
SOURCETABLES:
select * from FUSION.MSC_AP_BOMS_V where assembly_name like 'AKSP%' and organization_id = 207;
select * from FUSION.EGP_STRUCTURES_B;
select * from FUSION.MSC_AP_BOM_COMPONENTS_V where assembly_name like 'AKSP-SFTWR' and organization_id = 207;

Select * from FUSION.MSC_AP_WORK_DEFINITIONS_V where ASSEMBLY_NAME like 'AKSP%';


select * from FUSION.MSC_AP_WD_OP_MATERIALS_V where component_name like 'AKSP%';
select * from FUSION.MSC_AP_WD_OPERATIONS_V where ASSEMBLY_NAME like 'AKSP%';
select * from FUSION.MSC_AP_WD_OP_RESOURCES_V where assembly_name like 'AKSP%';

STAGINGTABLES:
select * from FUSION.MSC_ST_SYSTEM_ITEMS where refresh_number = '34099';
select * from FUSION.MSC_ST_BOMS where refresh_number = '32634';
select * from FUSION.MSC_ST_BOMS where assembly_name like 'AK-C%';
select * from FUSION.MSC_ST_BOM_COMPONENTS where refresh_number = '32634';
select * from FUSION.MSC_ST_BOM_COMPONENTS where assembly_name like 'AK-C%';
select * from FUSION.MSC_ST_WORK_DEFINITIONS_INT where REFRESH_NUMBER = 32634 and work_def_name like 'AK-ATO-
%' and PROCESS_FLAG=5;
SELECT * FROM FUSION.MSC_ST_WD_OP_MATR_INT WHERE REFRESH_NUMBER = 30676 AND PROCESS_FLAG=5;
select * from FUSION.MSC_ST_WD_OP_RES_INT where REFRESH_NUMBER = 30676 and PROCESS_FLAG=5;
select * from FUSION.MSC_ST_WD_OPERATIONS_INT where REFRESH_NUMBER = 30676 and PROCESS_FLAG=5;

DESTINATIONTABLES:
select a.item_number, a.* from EGP_SYSTEM_ITEMS a where item_number like 'AK-CTO%';
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-%';
select * from FUSION.MSC_BOMS where assembly_item_id in ('735035') and plan_id =-1;
select * from FUSION.MSC_BOMS where refresh_number = 37534;
select * from FUSION.MSC_BOM_COMPONENTS where plan_id = -1 and bill_sequence_id = '15434';
select * from FUSION.MSC_BOM_COMPONENTS where refresh_number = 37534;
select * from FUSION.MSC_WD_OPERATION_MATERIALS where WORK_DEFINITION_CODE like 'AK-ATO%';
select * from FUSION.MSC_PROCESS_EFFECTIVITY where item_id = '730848' and plan_id = -1;
select * from FUSION.MSC_BOMS where SR_WD_NAME like 'DOS%';

select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AK-CTO%';


select * from FUSION.MSC_WORK_DEFINITIONS where WORK_DEF_NAME like 'TEST-%' and assembly_item_id = '11329';
select * from FUSION.MSC_ROUTINGS where assembly_item_id in ('13788');
select * from FUSION.MSC_ROUTING_OPERATIONS where routing_sequence_id in ('10060');
select * from FUSION.MSC_OPERATION_RESOURCE_SEQS where routing_sequence_id in ('10060');

select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-LAPTOP%';


select * from FUSION.MSC_ST_SYSTEM_ITEMS where refresh_number = '20827';

SELECT requestid, parentrequestid, to_char(processstart-7/24, 'DD-MON-YYYY HH24:MI:SS') processstart,


to_char(processend-7/24, 'DD-MON-YYYY HH24:MI:SS') processend, executable_status, definition,
error_warning_message, errortype, redirectedoutputfile FROM FUSION_ORA_ESS.REQUEST_HISTORY START WITH
requestid = 160250 CONNECT BY PRIOR requestid = parentrequestid order by requestid;

--CTO ITEMS
select * from FUSION.MSC_API_WORK_DEF_HEADER where config_item_id = '300100075494042';
select * from FUSION.MSC_API_WD_OPERATION where config_item_id = '300100075494042';
select * from FUSION.MSC_API_WD_OP_MATERIALS where config_item_id = '300100075494042';
select * from FUSION.MSC_API_WD_OP_RESOURCES where config_item_id = '300100075494042';
select * from FUSION.MSC_ST_WORK_DEFINITIONS_INT where assembly_name like 'AK-CTO-L%';
select * from FUSION.MSC_ST_WD_OPERATIONS_INT where assembly_name like 'AK-CTO-L%';
select * from FUSION.MSC_ST_WD_OP_MATR_INT where assembly_name like 'AK-CTO-L%';
select * from FUSION.MSC_ST_WD_OP_RES_INT where assembly_name like 'AK-CTO-L%';

select assem.ITEM_NAME, compo.ITEM_NAME, comp.OPERATION_SEQ_NUM, comp.USAGE_QUANTITY from


FUSION.MSC_BOM_COMPONENTS comp,
FUSION.MSC_SYSTEM_ITEMS assem, FUSION.MSC_SYSTEM_ITEMS compo
where USING_ASSEMBLY_ID in (
734238)
and comp.USING_ASSEMBLY_ID = assem.INVENTORY_ITEM_ID
and comp.ORGANIZATION_ID = assem.ORGANIZATION_ID
and comp.INVENTORY_ITEM_ID = compo.INVENTORY_ITEM_ID
and comp.ORGANIZATION_ID = compo.ORGANIZATION_ID
and comp.PLAN_ID = -1
and assem.PLAN_ID = -1
and compo.PLAN_ID = -1;

select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-LAPTOP%';

--ROUTING/ROUTING OPERATIONS/ROUTING OPS RESOURCES --- CSV cases


select * from FUSION.MSC_DEPARTMENT_RESOURCES where resource_code like 'JI%' and plan_id = -1;
select * from FUSION.MSC_DEPARTMENT_RESOURCES where organization_id = 10283;
select * from FUSION.MSC_BOMS where ASSEMBLY_ITEM_ID = '732226';
select * from FUSION.MSC_ROUTINGS where routing_name like 'LFS-%';
select * from FUSION.MSC_PROCESS_EFFECTIVITY where ITEM_ID = '732226';
select * from FUSION.MSC_ROUTING_OPERATIONS where ASSEMBLY_ITEM_ID = '732226'; -- refresh_number = '20928';
select * from FUSION.MSC_ROUTING_OPERATIONS where part_key1 = '100000011825006' ORDER by ROUTING_SEQUENCE_ID;
select * from FUSION.MSC_OPERATION_RESOURCES where refresh_number = '20388';
select * from FUSION.MSC_OPERATION_RESOURCES where part_key1 = '100000011825006' ORDER by
ROUTING_SEQUENCE_ID;
select * from FUSION.MSC_OPERATION_RESOURCE_SEQS where refresh_number = '20388';

select * from FUSION.MSC_ROUTINGS where refresh_number = '18482';


select * from FUSION.MSC_ROUTING_OPERATIONS where refresh_number = '18482';
select * from FUSION.MSC_OPERATION_RESOURCES where refresh_number = '18482';

select a.error_text, a.* from FUSION.MSC_ST_ROUTINGS a where refresh_number = '18482';


select a.error_text, a.* from FUSION.MSC_ST_ROUTING_OPERATIONS a where refresh_number = '18482';
select a.error_text, a.* from FUSION.MSC_ST_OPERATION_RESOURCES a where refresh_number = '18482';

select * from FUSION.MSC_ST_ROUTING_OPERATIONS a where process_flag = '5' and proces;

select PLAN_ID, PART_KEY1, ORGANIZATION_ID, ASSEMBLY_ITEM_ID, ROUTING_NAME, ALTERNATE_ROUTING_DESIGNATOR,


UOM_CODE, CTP_FLAG, CFM_ROUTING_FLAG,ROUTING_QUANTITY, PREFERENCE, ROUTING_SEQUENCE_ID from
FUSION.MSC_ROUTINGS where refresh_number = '20831';
select PLAN_ID, PART_KEY1, ASSEMBLY_ITEM_ID, ORGANIZATION_ID, ROUTING_SEQUENCE_ID, OPERATION_SEQUENCE_ID,
UOM_CODE,OPERATION_SEQ_NUM,EFFECTIVITY_DATE,DEPARTMENT_ID,DEPARTMENT_CODE,OPTION_DEPENDENT_FLAG,DISABLE_DATE,
YIELD,NET_PLANNING_PERCENT,STANDARD_OPERATION_CODE,REFRESH_NUMBER from MSC_ROUTING_OPERATIONS where
refresh_number = '20596';
select PLAN_ID, ROUTING_SEQUENCE_ID, OPERATION_SEQUENCE_ID, ORGANIZATION_ID, RESOURCE_SEQ_NUM, DEPARTMENT_ID
from FUSION.MSC_OPERATION_RESOURCE_SEQS where refresh_number = '20596';
select PLAN_ID, PART_KEY1, ROUTING_SEQUENCE_ID, OPERATION_SEQUENCE_ID, ORGANIZATION_ID, RESOURCE_ID,
RESOURCE_SEQ_NUM, DEPARTMENT_ID, SCHEDULE_FLAG, ALTERNATE_NUMBER, RESOURCE_TYPE, PRINCIPAL_FLAG, BASIS_TYPE,
RESOURCE_USAGE, RESOURCE_UNITS, UOM_CODE from FUSION.MSC_OPERATION_RESOURCES where part_key1 =
'100000011825006' ORDER by ROUTING_SEQUENCE_ID;--where refresh_number = '20596';

-- SOURCING RULES/ASSIGNMENTS
select * from FUSION.MSC_SOURCING_RULES where refresh_number = '18388';
select * from FUSION.MSC_SR_RECEIPT_ORG where refresh_number = '18388';
select * from FUSION.MSC_SR_SOURCE_ORG where refresh_number = '18388';

select a.error_text, a.* from FUSION.MSC_ST_SOURCING_RULES a where refresh_number = '18388';


select a.error_text, a.* from FUSION.MSC_ST_SR_RECEIPT_ORG a where refresh_number = '18388';
select a.error_text, a.* from FUSION.MSC_ST_SR_SOURCE_ORG a where refresh_number = '18388';

select * from FUSION.MSC_SOURCING_RULES where SOURCING_RULE_NAME like 'AK%';


select * from FUSION.MSC_SR_SOURCE_ORG where sourcing_rule_name in (select sourcing_rule_name from
FUSION.MSC_SOURCING_RULES where SOURCING_RULE_NAME like 'RT-GPR-MAKE%');
select * from FUSION.MSC_SR_RECEIPT_ORG where sourcing_rule_id in (select sourcing_rule_id from
FUSION.MSC_SOURCING_RULES where SOURCING_RULE_NAME like 'RT-GPR-MAKE%');

select * from FUSION.MSC_DIM_CUST_V;


select * from FUSION.MSC_DIM_CUST_SITE_V;
select * from FUSION.MSC_REGIONS_V where COUNTRY_CODE = 'US' and REGION_NAME like 'WE%';
select * from FUSION.MSC_REGIONS_V where COUNTRY_CODE = 'US' and REGION_LEVEL = '2';
--SOURCING ASSIGNMENTS
select * from FUSION.MSC_ASSIGNMENT_SETS where refresh_number = '18388';
select * from FUSION.MSC_SR_ASSIGNMENTS where refresh_number = '18388';
select a.error_text,A.SOURCING_RULE_NAME,a.ASSIGNMENT_SET_NAME,a.assignment_type, a.* from
MSC_st_SR_ASSIGNMENTS a where REFRESH_NUMBER ='18388';
select profile_option_value from FND_PROFILE_OPTION_VALUES where profile_option_id in (select
profile_option_id from FND_PROFILE_OPTIONS_VL where
PROFILE_OPTION_NAME like 'MSC_SRC_ASSIGNMENT_CATALOG%');
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AK-COLLS-B2B%';

--PLANNED ORDER SUPPLIES


select * from FUSION.MSC_SUPPLIES where order_type = '5' and plan_id = '-1' and refresh_number = '24055';
select * from MSC_PLANS;
select transaction_id, plan_id, alternate_bom_designator, alternate_routing_designator, bill_sequence_id,
firm_planned_type, inventory_item_id, new_order_quantity, new_schedule_date, order_type, organization_id,
routing_sequence_id, schedule_designator, schedule_line_num, source_organization_id, supplier_id,
supplier_site_id, fg_order_type, part_key1, refresh_number from FUSION.MSC_SUPPLIES where order_type = '5'
and plan_id = '-1' and organization_id = '10240';
select a.error_text, a.item_name, a.process_flag, a.* from FUSION.MSC_ST_SUPPLIES a where refresh_number =
'22011';
select a.error_text, a.item_name, a.sr_instance_code, a.* from FUSION.MSC_ST_SUPPLIES a where refresh_number
= '22009';
select a.error_text, a.item_name, a.sr_instance_code, a.* from FUSION.MSC_ST_SUPPLIES a where
sr_instance_code = 'LegacyFS'; --refresh_number = '22407';
select * from FUSION.MSC_BOMS where assembly_item_id like in (724826,726520);
select * from FUSION.MSC_ROUTINGS where assembly_item_id in ('724826','726520') and part_key1 =
'100010026240311';
select * from FUSION.MSC_BOMS;
select * from fusion.msc_plan_definitions;

--SUBINVENTORIES
select * from FUSION.MSC_SUB_INVENTORIES where plan_id = '-1' and sub_inventory_code like 'Lynn%'; --
organization_id in ('10240','10061'); --1260
select * from FUSION.MSC_SUB_INVENTORIES where plan_id = '-1' and organization_id = '10105'; --148
select * from FUSION.MSC_ST_SUB_INVENTORIES where ERROR_TEXT is not null;
select * from FUSION.MSC_SUB_INVENTORIES where plan_id = '-1' and refresh_number = '20674';
select * from FUSION.MSC_AP_SUB_INVENTORIES_V where sub_inventory_code like 'Ly%';

--WIP SUPPLIES
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AK-CTO-LAPTOP*%';
select * from FUSION.MSC_DEPARTMENT_RESOURCES where ORGANIZATION_ID = '10001' and RESOURCE_CODE like 'AK-%';
select * from FUSION.MSC_ROUTINGS where organization_id = '10060';
select * from FUSION.MSC_BOMS where organization_id = '10060';
select * from FUSION.MSC_SUPPLIES where INVENTORY_ITEM_ID in ('728225','728226');
select a.fg_order_type, a.error_text, a.wip_entity_name, a.wip_start_quantity, a.work_order_sub_type, a.*
from FUSION.MSC_ST_SUPPLIES a where refresh_number = '29184';
select
transaction_id,organization_id,part_key1,inventory_item_id,new_schedule_date,new_wip_start_date,order_type,ne
w_order_quantity,firm_planned_type,operation_seq_num,order_number,wip_entity_name,late_supply_date,late_suppl
y_qty,qty_scrapped,qty_completed,wip_status_code,wip_supply_type,routing_sequence_id,bill_sequence_id,wip_sta
rt_quantity,quantity_issued,quantity_per_assembly,schedule_priority,work_order_sub_type,revision,build_sequen
ce,refresh_number from FUSION.MSC_SUPPLIES where inventory_item_id = '731480'; --WIP_ENTITY_NAME like
'WO_M110753%';
select * from FUSION.MSC_SUPPLIES where inventory_item_id = '13098';

select * from msc_organizations_v;


select * from FUSION.MSC_AP_WIP_JOB_SUPPLIES_V where WIP_ENTITY_NAME like 'AK-NONSTD-%';
select * from FUSION.MSC_AP_WIP_JOB_SUPPLIES_V where item_name like 'RT-A-DC1001%' and ORGANIZATION_CODE =
'M1';
select mccs.refresh_number from msc_coll_cycle_status mccs, msc_cc_modified_entities mce,msc_apps_instances
mpi where mccs.refresh_number = mce.last_cycle_id and mpi.instance_id = mce.instance_id
and mce.entity = 'WIPSUPPLIES' and mpi.instance_code = 'LegacyFS';

select text from dba_source where name like 'MSC_COLL_WIP%';


select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'RT-A-DC1001%'; ---78034
select * from msc_supplies where refreshwip_entity_name = 'WO-PIM1-NEW1';

select * from msc_wo_attributes;

--WORK-ORDER OPS RESOURCES


select * from FUSION.MSC_RESOURCE_REQUIREMENTS where WIP_ENTITY_NAME = 'M11006'; -- is not null; --
ASSEMBLY_ITEM_ID in ('13788','731480','731481');
select a.error_text, a.wip_entity_name, a.* from FUSION.MSC_ST_RESOURCE_REQUIREMENTS a where refresh_number =
'21075';

select RESOURCE_HOURS,
transaction_id,supply_id,organization_id,assembly_item_id,department_id,resource_id,wip_entity_name,routing_s
equence_id,operation_sequence_id,resource_seq_num,operation_seq_num,alternate_num,start_date,end_date,resourc
e_hours,assigned_units,hours_expended,basis_type,supply_type,quantity_completed,std_op_code,quantity_in_queue
,quantity_running,quantity_waiting_to_move,yield,usage_rate,schedule_flag,principal_flag,refresh_number,sched
uled_completion_date,scheduled_quantity from FUSION.MSC_RESOURCE_REQUIREMENTS where WIP_ENTITY_NAME like 'WO-
M1-%';

--WIP COMPONENT DEMANDS


select * from FUSION.MSC_DEMANDS where WIP_ENTITY_NAME like 'MK-M1-45';
select a.error_text, a.wip_entity_name,a.using_assembly_demand_date, a.* from FUSION.MSC_ST_DEMANDS a where
refresh_number = '23256';

select
demand_id,plan_id,disposition_id,organization_id,inventory_item_id,using_requirement_quantity,using_assembly_
demand_date,using_assembly_item_id,order_number,origination_type,wip_entity_name,op_seq_num,wip_supply_type,o
peration_effectivity_date,quantity_per_assembly,issued_quantity,refresh_number from FUSION.MSC_DEMANDS where
USING_ASSEMBLY_ITEM_ID = '13098' and WIP_ENTITY_NAME is not null;

select
demand_id,plan_id,disposition_id,organization_id,inventory_item_id,using_requirement_quantity,using_assembly_
demand_date,using_assembly_item_id,order_number,origination_type,wip_entity_name,op_seq_num,wip_supply_type,o
peration_effectivity_date,quantity_per_assembly,issued_quantity,refresh_number from FUSION.MSC_DEMANDS where
USING_ASSEMBLY_ITEM_ID in ('13788','731480','731481') and WIP_ENTITY_NAME is not null;

--CATEGORY SETS/CATALOG
select * from FUSION.MSC_AP_CATEGORY_SETS_V where category_set_name like 'Planning %'; 298
select * from FUSION.MSC_AP_CATALOG_CATEGORIES_V where category_set_name like 'Planning Item%'; 13948
select * from FUSION.MSC_AP_ITEM_CATEGORIES_V where item_name = 'AK-TEST-CP'; 2621478

select * from egp_category_sets_vl where category_set_name like 'AK%';


select * from FUSION.MSC_CATEGORY_SETS where refresh_number = '22161';
select * from FUSION.MSC_CATEGORY_SETS where category_set_name like 'Planning Item%';
select * from FUSION.MSC_CATALOG_CATEGORIES where refresh_number = '22161';
select * from FUSION.MSC_CATALOG_CATEGORIES where category_Set_id = '10184';
select * from FUSION.MSC_ITEM_CATEGORIES where CATEGORY_ID = '453';
select * from FUSION.MSC_ITEM_CATEGORIES where inventory_item_id in (731765);-- and category_id = '202854';
select * from FUSION.MSC_ITEM_CATEGORIES where inventory_item_id in (727787,726560,726566,726561,726562) and
category_id = '202854';

select * from FUSION.MSC_ST_CATEGORY_SETS where refresh_number = '26113';


select * from FUSION.MSC_ST_ITEM_CATEGORIES where item_name like 'JISOP-T207';
select * from FUSION.MSC_ST_CATALOG_CATEGORIES where refresh_number = '17921';
select * from FUSION.MSC_SYSTEM_ITEMS where inventory_item_id in (select inventory_item_id from
FUSION.MSC_ITEM_CATEGORIES where CATEGORY_ID = '453');

select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AK-CTO%';


select msi.item_name,
mic.category_id,
mcc.category_name,
mic.* from fusion.MSC_ITEM_CATEGORIES mic,fusion.msc_system_items msi,fusion.msc_catalog_categories mcc
where mic.inventory_item_id=msi.inventory_item_id
and mic.organization_id=msi.organization_id
and mcc.category_id=mic.category_id
and mic.organization_id in (1644,10160,10163,10161,10164,10165);

--SAFETY STOCKS
select * from FUSION.MSC_SAFETY_STOCKS where organization_id = '10060' and inventory_item_id like '724643';
select * from FUSION.MSC_SAFETY_STOCKS where refresh_number = '30828';
select * from FUSION.MSC_ST_SAFETY_STOCKS where refresh_number = '30828';

select * from FUSION.MSC_CUSTOMERS_V where partner_number = '1137';


select * from FUSION.MSC_CUSTOMER_SITES_V where 1284;
select * from FUSION.MSC_CUSTOMERS_TCA_V;
select * from FUSION.HZ_IMP_PARTIES_T where party_number like 'OP%'; = '300100005968998'; --300100005968998

select * from FUSION.HZ_IMP_ACCOUNTS_T;


select * from FUSION.hz_cust_accounts where last_updated_by = 'BULK_IMPORT';

--DEMAND FORECAST - CROSS REF


select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-LAPTOP%';
select USING_ASSEMBLY_DEMAND_DATE from FUSION.MSC_DEMANDS where refresh_number = '22845';
select * from FUSION.MSC_DEMANDS where inventory_item_id = '734238' and plan_id = -1 and FORECAST_SET_ID =
'10580';
select * from FUSION.MSC_DEMANDS where schedule_designator_id in (11420,
11421,
11425,
11426);
select * from FUSION.MSC_DESIGNATORS where refresh_number = '19546';
select * from FUSION.MSC_DESIGNATORS where designator like 'AK-CTO%';
select a.error_text, a.forecast_priority, a.* from FUSION.MSC_ST_DEMANDS a where refresh_number = '19546';
select a.error_text, a.organization_code, a.* from FUSION.MSC_ST_DEMANDS a where refresh_number = '24539';
select a.probability, a.* from FUSION.MSC_DEMANDS a where refresh_number = '20522';
select
forecast_avg_interarrival_time,forecast_intermit_demand_flag,forecast_mape,demand_schedule_name,forecast_mad,
demand_id,schedule_designator_id,using_requirement_quantity,assembly_demand_comp_date,using_assembly_demand_d
ate,demand_type,origination_type,forecast_priority,organization_id,inventory_item_id,customer_id,customer_sit
e_id,part_key1,demand_class,confidence_percentage,bucket_type,probability,forecast_set_id,refresh_number from
FUSION.MSC_DEMANDS where inventory_item_id = '730002'; -- refresh_number = '23819';
select
demand_schedule_name,demand_id,schedule_designator_id,using_requirement_quantity,using_assembly_demand_date,d
emand_type,origination_type,organization_id,inventory_item_id,bucket_type,forecast_set_id,refresh_number from
FUSION.MSC_DEMANDS where schedule_designator_id in (11420,
11421,
11425,
11426);

select * from msc_period_start_dates dates,msc_parameters orgs where dates.period_start_date ='28-JUL-14'


and dates.calendar_code=orgs.calendar_code and orgs.organization_id = 207;

--ONHAND
select a.order_type, a.inventory_item_id, a.new_order_quantity,a.SUBINVENTORY_CODE, a.* from
FUSION.MSC_SUPPLIES a where order_type = '18' and inventory_item_id = '735082' and organization_id = '10001';
select * from FUSION.MSC_SUPPLIES where inventory_item_id = '11704' and order_type = '18';
select * from FUSION.MSC_SUPPLIES where refresh_number = '22637' and order_type = '18' and inventory_item_id
in (select inventory_item_id from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-LAPTOP%');
select a.error_text, a.order_type, a.* from FUSION.MSC_ST_SUPPLIES a where refresh_number = '26274' and
order_type = '18' and organization_id in (207,204);
select * from FUSION.MSC_SUB_INVENTORIES where organization_id = '10240';
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-LAPTOP%';
select * from MSC_AP_ONHAND_SUPPLIES_V where inventory_item_id = '300100082416943';
select a.item_number, a.* from egp_system_items a where item_number like 'AKSP-LAPTOP%';
select * from MSC_AP_ONHAND_SUPPLIES_V where inventory_item_id in (select inventory_item_id from
EGP_SYSTEM_ITEMS where item_number like 'AKSP-LAP%') and organization_code = 'M1';

select inventory_item_id, organization_id, order_type, new_order_quantity, refresh_number from


fusion.msc_supplies where
inventory_item_id in (select inventory_item_id from fusion.msc_system_items where item_name like 'AKSP%')and
plan_id=-1;
--ITEM SUBSTITUTE
select * from FUSION.MSC_ITEM_SUBSTITUTES where refresh_number = '28154';
select * from FUSION.MSC_ITEM_SUBSTITUTES where lower_item_id = '728064';
select * from FUSION.MSC_ITEM_SUBSTITUTES where lower_item_id = '726560';
select a.error_text, a.* from FUSION.MSC_ST_ITEM_SUBSTITUTES a where refresh_number = '28154';
select * from FUSION.MSC_SYSTEM_ITEMS where inventory_item_id = '726566';
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like '0VP-PIM%' and plan_id = '-1';
select * from FUSION.MSC_CUSTOMERS_V;
select * from FUSION.MSC_CUSTOMER_SITES_V where partner_id = '1006';`
select * from EGP_ITEM_RELATIONSHIPS_VL where inventory_item_id = '300100036926531';
select a.item_number,a.organization_id, a.* from EGP_SYSTEM_ITEMS a where item_number like '0VP-P%';

--SALES ORDER
select * from FUSION.MSC_DEMANDS where sales_order_number like ('734956');
select INVENTORY_ITEM_ID, CONFIGURED_ITEM from FUSION.MSC_DEMANDS where inventory_item_id = '734238' and
origination_type = '1030' and plan_id = -1;
select count(*) from FUSION.MSC_DEMANDS where origination_type = '1030' and organization_id = 207 and plan_id
= -1; -- 11049 and M1 - 5784 (4944) --- 5120
select a.error_text, a.sales_order_number, a.* from FUSION.MSC_ST_DEMANDS a where item_name like 'AK-CTO-
LAPTOP%' order by creation_date desc; --2018120215
select a.error_text, a.sales_order_number, a.* from FUSION.MSC_ST_DEMANDS a where refresh_number = '22488'
AND error_text is not null and a.SALES_ORDER_NUMBER = '425146';
select a.sales_order_number, a.inventory_item_id, a.organization_id, a.promise_arrival_date,
a.promise_ship_date, a.schedule_ship_date, a.schedule_arrival_date, a.demand_source_system_id, a.* from
FUSION.MSC_DEMANDS a where refresh_number = '22858' and inventory_item_id = '514525'; --sales_order_number
like 'SO-LAP%';
select * from FUSION.MSC_AP_SALES_ORDER_V where SALES_ORDER_NUMBER = '300100082383815';
select * from DOO_LINES_ALL LINES where inventory_item_id = '300100082383815';
select * from FUSION.DOO_FULFILLMENT_LINES_ALL;
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-LAP%' and plan_id = -1;
select a.item_number, a.inventory_item_id, a.* from EGP_SYSTEM_ITEMS a where item_number like 'AKSP-%';
select a.inventory_item_id, a.original_item_id, a.organization_id,a.receiving_org_id,
a.using_requirement_quantity,a.completed_quantity,a.sales_order_header_id, a.orch_order_header_id,
a.sales_order_line_id, a.orch_order_line_id, a.so_line_num, a.sales_order_number,
a.using_assembly_demand_date, a.schedule_arrival_date,a.request_date, a.promise_arrival_date,
a.promise_ship_date, a.latest_acceptable_ship_date, a.latest_acceptable_arrival_date, a.ordered_date,
a.order_date_type_code, a.shipping_method_code, a.carrier_id, a.service_level, a.mode_of_transport,
a.customer_id, a.ship_to_site_id, a.bill_to_site_id, a.ship_set_name, a.arrival_set_name, a.demand_priority,
a.demand_class, a.ordered_uom, a.supplier_id, a.supplier_site_id, a.demand_source_type,
a.shipping_preference, a.root_fulfillment_line, a.parent_fulfillment_line, a.configured_item,
a.included_items_flag, a.demand_id, a.using_assembly_item_id, a.selling_price, a.salesrep_contact,
a.customer_po_number, a.customer_po_line_number, a.customer_po_schedule_number, a.intransit_lead_time,
a.min_rem_shelf_life_days, a.inventory_organization_id, a.allow_splits, a.allow_substitution,
a.fulfillment_cost, a.fulfillment_line_num, a.source_schedule_number, a.demand_source_system_id,
a.item_type_code, a.item_sub_type_code, a.order_margin, a.promising_system, a.delivery_cost,
a.delivery_lead_time, a.orch_order_number, a.orch_order_line_number, a.min_percentage_for_split,
a.min_quantity_for_split, a.source_document_number, a.source_document_line_number,
a.supplier_site_source_system_id from FUSION.MSC_DEMANDS a where inventory_item_id in ('731766') and plan_id
= -1; --sales_order_number like '808082';
select a.sales_order_number, a.inventory_item_id, a.ORGANIZATION_ID from FUSION.MSC_DEMANDS a where
a.DEMAND_SOURCE_SYSTEM_ID = '100010026240309';

select a.error_text, a.sales_order_number, a.* from FUSION.MSC_ST_DEMANDS a where error_text is not null;

--RESERVATIONS
select * from FUSION.MSC_SYSTEM_ITEMS where ITEM_NAME = 'AK-COLLS-B2B-MAKE';
select * from MSC_AP_ONHAND_SUPPLIES_V where inventory_item_id = '300100051822622';
select a.ORDER_NUMBER, a.ITEM_NAME, a.* from FUSION.MSC_AP_PO_PO_SUPPLY_V a where item_name = 'AK-COLLS-B2B-
BUY';
select * from FUSION.MSC_AP_PO_REQ_SUPPLY_V where item_name = 'AK-DSHIP-BUY';
select * from FUSION.MSC_AP_WIP_JOB_SUPPLIES_V where item_name like 'AKSP%';
select * from FUSION.MSC_AP_TRANSFER_ORDERS_V where order_type in (8,11) and organizcan you ation_code like
'M%';
select * from FUSION.MSC_AP_SALES_ORDER_V where sales_order_number in ('389105');
select * from MSC_AP_HARD_RESERVATIONS_V where item_name like 'AKSP-LAPTOP%';
r1
select * from MSC_AP_HARD_RESERVATIONS_V where disposition_id = '300100076086994';
select * from inv_reservations where source_fulfillment_line_id = '300100055392301'; -- reservation id :
300100055398031
select * from FUSION.MSC_RESERVATIONS where inventory_item_id in (select inventory_item_id from
FUSION.MSC_SYSTEM_ITEMS where item_name like 'AKSP-LAPTOP%'); -- and disposition_id = '300100076086994';
select * from FUSION.MSC_RESERVATIONS where refresh_number = '22655' and supply_source_type_id = 13 and
disposition_id = '300100076086994';
select * from FUSION.MSC_RESERVATIONS where inventory_item_id = '731520' and supply_source_type_id = 8;
select * from MSC_AP_HARD_RESERVATIONS_V where item_name like 'AKSP-LAPTOP%';
select a.error_text, a.sales_order_number, a.organization_code, a.* from MSC_ST_RESERVATIONS a where
item_name like 'AK-COLLS-B2B-MAKE%'; -- '19068';

select * From fusion.msc_reservations where inventory_item_id in ( select inventory_item_id from


fusion.msc_system_items where item_name like 'AKSP-%');

select * from FUSION.MSC_RESERVATIONS where disposition_id = '300100076086994';


select * from FUSION.INV_RESERVATIONS where supply_source_type_id = '5' and inventory_item_id =
'300100038291366';
select a.error_text, a.supply_source_type_id, a.deleted_flag, a.process_flag, a.DISPOSITION_ID, a.* from
MSC_ST_RESERVATIONS a where refresh_number = '21527';
select * from fusion.MLOG$_INV_RESERVATIONS;
select * from fusion.doo_document_references where header_id in (select sales_order_header_id from
FUSION.MSC_AP_SALES_ORDER_V where sales_order_number in ('348088','348091', '348092', '348093','348094'));

--BACK TO BACK SO CASES:


select * from FUSION.MSC_AP_SALES_ORDER_V where sales_order_number like 'SO-LAP%'; --877081--904084--904106
select a.inventory_item_id, a.item_number, a.* from EGP_SYSTEM_ITEMS a where item_number like 'AK-COLLS-
B2B%';
select a.SUBINVENTORY_CODE, a.ORDER_NUMBER, a.drop_ship_cust_name, a.drop_ship_dest_type, a.* from
FUSION.MSC_AP_PO_PO_SUPPLY_V a where item_name = 'AK-COLLS-B2B-BUY';
select * from MSC_AP_HARD_RESERVATIONS_V where item_name = 'AK-COLLS-B2B-MAKE' and organization_id = '207';

B2B BUY
select SUPPLY_ORDER_REFERENCE_LINE_ID from fusion.dos_supply_lines_int WHERE CUSTOMER_ORDER_NUMBER LIKE
'237093'; --915080 -- 877081
SELECT header_id FROM fusion.dos_supply_lines WHERE SUPPLY_ORDER_REFERENCE_LINE_ID IN (300100071463119);
Select * from fusion.dos_supply_tracking_line_docs WHERE HEADER_ID = 300100071449880;

select * from fusion.inv_reservations where inventory_item_id = 300100063644350 ;

select SUPPLY_ORDER_REFERENCE_LINE_ID from fusion.dos_supply_lines_int WHERE CUSTOMER_ORDER_NUMBER LIKE


'247082'; -- AKB2B0202_2
SELECT header_id FROM fusion.dos_supply_lines WHERE SUPPLY_ORDER_REFERENCE_LINE_ID IN (300100071568510);
select * from FUSION.dos_supply_tracking_line_docs where header_id = 300100071450475;

B2B MAKE
select SUPPLY_ORDER_REFERENCE_LINE_ID from fusion.dos_supply_lines_int WHERE CUSTOMER_ORDER_NUMBER LIKE
'241082%';
SELECT header_id FROM fusion.dos_supply_lines WHERE SUPPLY_ORDER_REFERENCE_LINE_ID IN (300100071467569);
Select * from fusion.dos_supply_tracking_line_docs WHERE HEADER_ID = 300100071450004;
select * from fusion.inv_reservations where inventory_item_id = 300100052148284 ;

B2B TRANSFER
select SUPPLY_ORDER_REFERENCE_LINE_ID from fusion.dos_supply_lines_int WHERE CUSTOMER_ORDER_NUMBER LIKE
'340090';
SELECT header_id FROM fusion.dos_supply_lines WHERE SUPPLY_ORDER_REFERENCE_LINE_ID IN (300100056709765);
Select * from fusion.dos_supply_tracking_line_docs WHERE HEADER_ID = 300100056699539;
select * from fusion.inv_reservations where inventory_item_id = 300100052148259 ;

select * from fusion.msc_atp_supply_release_intf where item_id = 300100051624526;

B2B ONHAND
select SUPPLY_ORDER_REFERENCE_LINE_ID from fusion.dos_supply_lines_int WHERE CUSTOMER_ORDER_NUMBER LIKE
'258154%';
select * from fusion.dos_supply_lines_int WHERE SUPPLY_ORDER_REFERENCE_LINE_ID IN (300100096839362);
SELECT * FROM fusion.dos_supply_lines WHERE SUPPLY_ORDER_REFERENCE_LINE_ID IN (300100096839362);
Select * from fusion.dos_supply_tracking_line_docs WHERE HEADER_ID = 300100056152907;
select * from fusion.inv_reservations where inventory_item_id = 300100052148284 ;

select * from fusion.msc_atp_supply_release_intf order by creation_date desc;

--ITEM XREF MAPPING


select * from FUSION.MSC_INSTANCE_ORGS;
select a.inventory_item_id, a.item_number, a.* from EGP_SYSTEM_ITEMS_VL a where inventory_item_id =
'100000012055019';
select a.inventory_item_id, a.item_number, a.* from EGP_SYSTEM_ITEMS_VL a where item_number like 'Z%';
select * from MSC_AP_EGP_SYSTEM_ITEMS_V;
select * from EGP_ITEM_RELATIONSHIPS_B where cross_reference like 'ITEMCROSSREF%'; f40000
select BACK_TO_BACK_FLAG from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AK-COLLS-B2B-BUY%';
select * from FUSION.MSC_ST_SYSTEM_ITEMS where refresh_number = '25728';

select * from MSC_XREF_MAPPING where attribute_name='UNITt_of_measure' and entity_name='ITEM' and


source_value<>target_value and sr_instance_id = 100000011825006;;
select * from MSC_XREF_MAPPING where attribute_name='ITEM_NAME' and entity_name='ITEM' and
source_value<>target_value and sr_instance_id = 100010026240311;
select * from MSC_XREF_MAPPING where attribute_name='ITEM_NAME' and entity_name='ITEM' and refresh_number =
'33995';
select * from MSC_XREF_MAPPING where entity_name='CARRIERS' and attribute_name='NAME';
select * from MSC_GLOBAL_TRADING_PARTNERS where partner_type = '4' and refresh_number = '34476';
=============================================================================================================
=========================================================================
--FUSION SOP:
--BILL OF RESOURCES
select a.UOM_CODE, a.* from FUSION.MSC_SYSTEM_ITEMS a where item_name like 'JISOP_Elec%' and plan_id = -1;
--731260, 731261
select * from FUSION.MSC_ITEM_CATEGORIES where inventory_item_id in (select inventory_item_id from
FUSION.MSC_SYSTEM_ITEMS where item_name like 'JISOP_Elec%' and plan_id = -1); --33489,33488

select a.error_text, a.* from FUSION.MSC_ST_AGGRPLAN_BOR_INT a where refresh_number = '19927';


select * from FUSION.MSC_AGGRPLANNING_BOR where plan_id = -1
and produced_item_id in (select inventory_item_id from FUSION.MSC_SYSTEM_ITEMS where item_name like
'JISOP_Elec%' and plan_id = -1);
=============================================================================================================
=========================================================================

select ITEM_NAME, DESCRIPTION, organization_code, INVENTORY_ITEM_FLAG, PICK_COMPONENTS_FLAG, BOM_ITEM_TYPE,


PURCHASING_ENABLED_FLAG, PLANNING_MAKE_BUY_code, MRP_PLANNING_CODE, ATO_FORECAST_CONTROL, planner_code,
BUYER_NAME, list_price, PREPROCESSING_LEAD_TIME, FULL_LEAD_TIME,POSTPROCESSING_LEAD_TIME, UOM_CODE,
FIXED_ORDER_QUANTITY, FIXED_LOT_MULTIPLIER, MINIMUM_ORDER_QUANTITY, MAXIMUM_ORDER_QUANTITY,
PLANNING_TIME_FENCE_CODE, DEMAND_TIME_FENCE_CODE, RELEASE_TIME_FENCE_CODE, SHRINKAGE_RATE,
SAFETY_STOCK_CODE, CUSTOMER_ORDER_FLAG, SHIPPABLE_ITEM_FLAG, WIP_Supply_Type from fusion.msc_system_items
where (item_name like 'AK-CTO-P%' or item_name in ('AK-CTO-MONITOR', 'AK-CTO-LAPTOP')) and plan_id=-1 and
ORGANIZATION_CODE = 'M1';

select distinct dm.SALES_ORDER_NUMBER, itm.item_name, dm.CONFIGURED_ITEM, dm.last_update_date,


dm.refresh_number from fusion.msc_demands DM, fusion.msc_system_items itm where
dm.inventory_item_id=itm.inventory_item_id and itm.item_name = 'AK-CTO-LAPTOP' and itm.organization_code='M1'
and dm.refresh_number=:last_refrNo;

select distinct spl.order_type, itm.item_name, SPL.INVENTORY_ITEM_ID, spl.order_number from


fusion.msc_supplies spl,
fusion.msc_system_items itm WHERE spl.inventory_item_id = itm.inventory_item_id and
spl.ORGANIZATION_ID=itm.ORGANIZATION_ID
and spl.inventory_item_id in (730848, 730905) and itm.organization_code ='M1' and spl.plan_id=-1;

desc fusion.msc_system_items;

select * from fusion.wie_work_orders_b wob;


select * from fusion.wie_wo_operations_b wopsb;
select * from fusion.wie_wo_operation_resources wor;
=============================================================================================================
=======================================================================
--ATO MODEL UNDER ATO MODEL:
-- WORK DEFINITIONS
SOURCETABLES:
select a.item_number, a.* from EGP_SYSTEM_ITEMS a where item_number like 'AK-CTO%';
select * from FUSION.MSC_AP_BOMS_V where assembly_name like 'AK-CTO-%'; -- and organization_id = 207;
select * from FUSION.EGP_STRUCTURES_B;
select * from FUSION.MSC_AP_BOM_COMPONENTS_V where assembly_name like 'AK-CTO-%'; -- and organization_id =
207;

Select * from FUSION.MSC_AP_WORK_DEFINITIONS_V where ASSEMBLY_NAME like 'AK-CTO%';


select * from FUSION.MSC_AP_WD_OP_MATERIALS_V where ASSEMBLY_NAME like 'AK-CTO%';
select * from FUSION.MSC_AP_WD_OPERATIONS_V where ASSEMBLY_NAME like 'AK-CTO%';
select * from FUSION.MSC_AP_WD_OP_RESOURCES_V where ASSEMBLY_NAME like 'AK-CTO-%';

STAGINGTABLES:
select * from FUSION.MSC_ST_SYSTEM_ITEMS where refresh_number = '32634';
select * from FUSION.MSC_ST_BOMS where refresh_number = '33035';
select * from FUSION.MSC_ST_BOMS where assembly_name like 'SCO-P2PCM-001%';
select * from FUSION.MSC_ST_BOM_COMPONENTS where refresh_number = '33035';
select * from FUSION.MSC_ST_BOM_COMPONENTS where assembly_name like 'AK-ATO-%';
select * from FUSION.MSC_ST_WORK_DEFINITIONS_INT where REFRESH_NUMBER = 32634 and work_def_name like 'AK-ATO-
%' and PROCESS_FLAG=5;
SELECT * FROM FUSION.MSC_ST_WD_OP_MATR_INT WHERE REFRESH_NUMBER = 33074 AND PROCESS_FLAG=2;
select * from FUSION.MSC_ST_WD_OP_RES_INT where REFRESH_NUMBER = 30676 and PROCESS_FLAG=5;
select * from FUSION.MSC_ST_WD_OPERATIONS_INT where REFRESH_NUMBER = 30676 and PROCESS_FLAG=5;

DESTINATIONTABLES:
select * from FUSION.MSC_SYSTEM_ITEMS where item_name like '%*%' and organization_id = 10001;
select * from FUSION.MSC_BOMS where assembly_item_id = '731480' and plan_id =-1;
select * from FUSION.MSC_BOMS where refresh_number = 30676;
select * from FUSION.MSC_BOM_COMPONENTS where using_assembly_id = '731480';
select * from FUSION.MSC_BOM_COMPONENTS where refresh_number = 30676;
select * from FUSION.MSC_BOM_COMPONENTS where using_assembly_id in (select inventory_item_id from
FUSION.MSC_SYSTEM_ITEMS where item_name like '%*%') and usage_quantity ;
select * from FUSION.MSC_WD_OPERATION_MATERIALS where WORK_DEFINITION_CODE like 'AK-TEST%';
select * from FUSION.MSC_PROCESS_EFFECTIVITY where item_id = '733008';

select * from FUSION.MSC_SYSTEM_ITEMS where item_name like 'AK-CTO-LAPTOP*198*';


select * from FUSION.MSC_WORK_DEFINITIONS where assembly_item_id = '731480';
select * from FUSION.MSC_ROUTINGS where assembly_item_id = '731480';
select * from FUSION.MSC_ROUTING_OPERATIONS where routing_sequence_id = '10061';
select * from FUSION.MSC_OPERATION_RESOURCE_SEQS where routing_sequence_id = '10061';

select * from FUSION.MSC_SYSTEM_ITEMS where inventory_item_id = '728963';


select a.net_planning_percent, a.* from FUSION.MSC_ROUTING_OPERATIONS a where assembly_item_id = '728963';

--CTO ITEMS
select * from FUSION.MSC_API_WORK_DEF_HEADER where config_item_id = '300100055261280';
select * from FUSION.MSC_API_WD_OPERATION where config_item_id = '300100055261280';
select * from FUSION.MSC_API_WD_OP_MATERIALS where config_item_id = '300100055261280';
select * from FUSION.MSC_API_WD_OP_RESOURCES where config_item_id = '300100055261280';

select * from FUSION.MSC_ST_WORK_DEFINITIONS_INT where assembly_name like 'AK-ATO-L%';


select * from FUSION.MSC_ST_WD_OPERATIONS_INT where assembly_name like 'AK-ATO-L%';
select * from FUSION.MSC_ST_WD_OP_MATR_INT where assembly_name like 'AK-ATO-L%';
select * from FUSION.MSC_ST_WD_OP_RES_INT where assembly_name like 'AK-ATO-L%';

--PLAN RUN QUERY:


SELECT requestid,parentrequestid,executable_status,definition,
submitter, to_char(processstart-7/24, 'DD-MON-YYYY HH24:MI:SS') processstart, to_char(processend-7/24, 'DD-
MON-YYYY HH24:MI:SS') processend,
name, error_warning_message, error_warning_detail, preprocess_status, preprocess_message, postprocess_status,
postprocess_message,
redirectedoutputfile FROM FUSION_ORA_ESS.REQUEST_HISTORY
START WITH requestid = 284837
CONNECT BY PRIOR requestid = parentrequestid order by requestid;

select pd.plan_id, pd.compile_designator , ws.managed_server_name


from fusion.msc_plan_definitions pd, fusion.msc_sp_web_services ws
where pd.plan_id(+) = ws.plan_id;

You might also like