Usage of Merge Statement in Oracle
The
MERGE INTO po_distributions_all D
USING (select y.po_header_id,x.expenditure_type, x.expenditure_org,x.expenditure_date
from xx_nic_po_headers x,
po_headers_all y
where x.final_po_no = y.segment1
and y.segment1 in
('H0010262')) S
ON (D.po_header_id=s.po_header_id)
WHEN MATCHED THEN UPDATE SET d.expenditure_type=s.expenditure_type,
d.expenditure_item_date=s.expenditure_date,
d.expenditure_organization_id=s.expenditure_org
Moving Personalizations from One Instance to Another Instance
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct $HOME/sud/fin/ldt/personalization/XX_NICSI_INVOICE_PER.ldt FND_FORM_CUSTOM_RULES function_name="AP_APXINWKB"
FNDLOAD apps/appsvis 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_NICSI_INVOICE_PER.ldt
The
MERGE
statement was introduced in Oracle 9i to conditionally insert or update data depending on its presence, a process also known as an "upsert". The MERGE
statement reduces table scans and can perform the operation in parallel if required.MERGE INTO po_distributions_all D
USING (select y.po_header_id,x.expenditure_type, x.expenditure_org,x.expenditure_date
from xx_nic_po_headers x,
po_headers_all y
where x.final_po_no = y.segment1
and y.segment1 in
('H0010262')) S
ON (D.po_header_id=s.po_header_id)
WHEN MATCHED THEN UPDATE SET d.expenditure_type=s.expenditure_type,
d.expenditure_item_date=s.expenditure_date,
d.expenditure_organization_id=s.expenditure_org
Moving Personalizations from One Instance to Another Instance
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct $HOME/sud/fin/ldt/personalization/XX_NICSI_INVOICE_PER.ldt FND_FORM_CUSTOM_RULES function_name="AP_APXINWKB"
FNDLOAD apps/appsvis 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct XX_NICSI_INVOICE_PER.ldt