73 - Useful SQL Queries in Word
73 - Useful SQL Queries in Word
73 - Useful SQL Queries in Word
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;
--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';
--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';
--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';
--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 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';
-- 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%';
--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 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';
-- 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');
-- 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;
-- 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 - 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 * 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%';
-- 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%';
-- 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;
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%';
--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%';
-- 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';
--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 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-%';
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
--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';
--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';
--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';
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;
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 ;
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 ;
desc fusion.msc_system_items;
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';
--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';