The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select Min(transaction_id),
Max(transaction_id)
Into from_trans,
to_trans
From CSI_TRANSACTIONS
Where creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS');
select 'x'
into l_exists
from CSI_II_FORWARD_SYNC_TEMP
where date_time_stamp <= to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
and process_flag <> 'P'
and rownum < 2;
Update CSI_OBJECT_DICTIONARY
Set last_archive_date = t_date;
Select csh.*
From CSI_ITEM_INSTANCES_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_ITEM_INSTANCES_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_inst_hist_rec_tab.instance_id.DELETE;
l_inst_hist_rec_tab.old_instance_number.DELETE;
l_inst_hist_rec_tab.new_instance_number.DELETE;
l_inst_hist_rec_tab.old_external_reference.DELETE;
l_inst_hist_rec_tab.new_external_reference.DELETE;
l_inst_hist_rec_tab.old_inventory_item_id.DELETE;
l_inst_hist_rec_tab.new_inventory_item_id.DELETE;
l_inst_hist_rec_tab.old_inventory_revision.DELETE;
l_inst_hist_rec_tab.new_inventory_revision.DELETE;
l_inst_hist_rec_tab.old_inv_master_org_id.DELETE;
l_inst_hist_rec_tab.new_inv_master_org_id.DELETE;
l_inst_hist_rec_tab.old_serial_number.DELETE;
l_inst_hist_rec_tab.new_serial_number.DELETE;
l_inst_hist_rec_tab.old_mfg_serial_number_flag.DELETE;
l_inst_hist_rec_tab.new_mfg_serial_number_flag.DELETE;
l_inst_hist_rec_tab.old_lot_number.DELETE;
l_inst_hist_rec_tab.new_lot_number.DELETE;
l_inst_hist_rec_tab.old_quantity.DELETE;
l_inst_hist_rec_tab.new_quantity.DELETE;
l_inst_hist_rec_tab.old_unit_of_measure.DELETE;
l_inst_hist_rec_tab.new_unit_of_measure.DELETE;
l_inst_hist_rec_tab.old_accounting_class_code.DELETE;
l_inst_hist_rec_tab.new_accounting_class_code.DELETE;
l_inst_hist_rec_tab.old_instance_condition_id.DELETE;
l_inst_hist_rec_tab.new_instance_condition_id.DELETE;
l_inst_hist_rec_tab.old_instance_status_id.DELETE;
l_inst_hist_rec_tab.new_instance_status_id.DELETE;
l_inst_hist_rec_tab.old_customer_view_flag.DELETE;
l_inst_hist_rec_tab.new_customer_view_flag.DELETE;
l_inst_hist_rec_tab.old_merchant_view_flag.DELETE;
l_inst_hist_rec_tab.new_merchant_view_flag.DELETE;
l_inst_hist_rec_tab.old_sellable_flag.DELETE;
l_inst_hist_rec_tab.new_sellable_flag.DELETE;
l_inst_hist_rec_tab.old_system_id.DELETE;
l_inst_hist_rec_tab.new_system_id.DELETE;
l_inst_hist_rec_tab.old_instance_type_code.DELETE;
l_inst_hist_rec_tab.new_instance_type_code.DELETE;
l_inst_hist_rec_tab.old_active_start_date.DELETE;
l_inst_hist_rec_tab.new_active_start_date.DELETE;
l_inst_hist_rec_tab.old_active_end_date.DELETE;
l_inst_hist_rec_tab.new_active_end_date.DELETE;
l_inst_hist_rec_tab.old_location_type_code.DELETE;
l_inst_hist_rec_tab.new_location_type_code.DELETE;
l_inst_hist_rec_tab.old_location_id.DELETE;
l_inst_hist_rec_tab.new_location_id.DELETE;
l_inst_hist_rec_tab.old_inv_organization_id.DELETE;
l_inst_hist_rec_tab.new_inv_organization_id.DELETE;
l_inst_hist_rec_tab.old_inv_subinventory_name.DELETE;
l_inst_hist_rec_tab.new_inv_subinventory_name.DELETE;
l_inst_hist_rec_tab.old_inv_locator_id.DELETE;
l_inst_hist_rec_tab.new_inv_locator_id.DELETE;
l_inst_hist_rec_tab.old_pa_project_id.DELETE;
l_inst_hist_rec_tab.new_pa_project_id.DELETE;
l_inst_hist_rec_tab.old_pa_project_task_id.DELETE;
l_inst_hist_rec_tab.new_pa_project_task_id.DELETE;
l_inst_hist_rec_tab.old_in_transit_order_line_id.DELETE;
l_inst_hist_rec_tab.new_in_transit_order_line_id.DELETE;
l_inst_hist_rec_tab.old_wip_job_id.DELETE;
l_inst_hist_rec_tab.new_wip_job_id.DELETE;
l_inst_hist_rec_tab.old_po_order_line_id.DELETE;
l_inst_hist_rec_tab.new_po_order_line_id.DELETE;
l_inst_hist_rec_tab.old_install_date.DELETE;
l_inst_hist_rec_tab.new_install_date.DELETE;
l_inst_hist_rec_tab.old_return_by_date.DELETE;
l_inst_hist_rec_tab.new_return_by_date.DELETE;
l_inst_hist_rec_tab.old_actual_return_date.DELETE;
l_inst_hist_rec_tab.new_actual_return_date.DELETE;
l_inst_hist_rec_tab.old_completeness_flag.DELETE;
l_inst_hist_rec_tab.new_completeness_flag.DELETE;
l_inst_hist_rec_tab.old_inst_context.DELETE;
l_inst_hist_rec_tab.new_inst_context.DELETE;
l_inst_hist_rec_tab.old_inst_attribute1.DELETE;
l_inst_hist_rec_tab.new_inst_attribute1.DELETE;
l_inst_hist_rec_tab.old_inst_attribute2.DELETE;
l_inst_hist_rec_tab.new_inst_attribute2.DELETE;
l_inst_hist_rec_tab.old_inst_attribute3.DELETE;
l_inst_hist_rec_tab.new_inst_attribute3.DELETE;
l_inst_hist_rec_tab.old_inst_attribute4.DELETE;
l_inst_hist_rec_tab.new_inst_attribute4.DELETE;
l_inst_hist_rec_tab.old_inst_attribute5.DELETE;
l_inst_hist_rec_tab.new_inst_attribute5.DELETE;
l_inst_hist_rec_tab.old_inst_attribute6.DELETE;
l_inst_hist_rec_tab.new_inst_attribute6.DELETE;
l_inst_hist_rec_tab.old_inst_attribute7.DELETE;
l_inst_hist_rec_tab.new_inst_attribute7.DELETE;
l_inst_hist_rec_tab.old_inst_attribute8.DELETE;
l_inst_hist_rec_tab.new_inst_attribute8.DELETE;
l_inst_hist_rec_tab.old_inst_attribute9.DELETE;
l_inst_hist_rec_tab.new_inst_attribute9.DELETE;
l_inst_hist_rec_tab.old_inst_attribute10.DELETE;
l_inst_hist_rec_tab.new_inst_attribute10.DELETE;
l_inst_hist_rec_tab.old_inst_attribute11.DELETE;
l_inst_hist_rec_tab.new_inst_attribute11.DELETE;
l_inst_hist_rec_tab.old_inst_attribute12.DELETE;
l_inst_hist_rec_tab.new_inst_attribute12.DELETE;
l_inst_hist_rec_tab.old_inst_attribute13.DELETE;
l_inst_hist_rec_tab.new_inst_attribute13.DELETE;
l_inst_hist_rec_tab.old_inst_attribute14.DELETE;
l_inst_hist_rec_tab.new_inst_attribute14.DELETE;
l_inst_hist_rec_tab.old_inst_attribute15.DELETE;
l_inst_hist_rec_tab.new_inst_attribute15.DELETE;
l_inst_hist_rec_tab.old_install_location_type_code.DELETE;
l_inst_hist_rec_tab.new_install_location_type_code.DELETE;
l_inst_hist_rec_tab.old_install_location_id.DELETE;
l_inst_hist_rec_tab.new_install_location_id.DELETE;
l_inst_hist_rec_tab.old_instance_usage_code.DELETE;
l_inst_hist_rec_tab.new_instance_usage_code.DELETE;
l_inst_hist_rec_tab.old_config_inst_rev_num.DELETE;
l_inst_hist_rec_tab.new_config_inst_rev_num.DELETE;
l_inst_hist_rec_tab.old_config_valid_status.DELETE;
l_inst_hist_rec_tab.new_config_valid_status.DELETE;
l_inst_hist_rec_tab.old_instance_description.DELETE;
l_inst_hist_rec_tab.new_instance_description.DELETE;
l_inst_hist_rec_tab.instance_history_id.DELETE;
l_inst_hist_rec_tab.transaction_id.DELETE;
l_inst_hist_rec_tab.old_last_vld_organization_id.DELETE;
l_inst_hist_rec_tab.new_last_vld_organization_id.DELETE;
l_inst_hist_rec_tab.old_last_oe_agreement_id.DELETE;
l_inst_hist_rec_tab.new_last_oe_agreement_id.DELETE;
l_inst_hist_rec_tab.inst_full_dump_flag.DELETE;
l_inst_hist_rec_tab.inst_created_by.DELETE;
l_inst_hist_rec_tab.inst_creation_date.DELETE;
l_inst_hist_rec_tab.inst_last_updated_by.DELETE;
l_inst_hist_rec_tab.inst_last_update_date.DELETE;
l_inst_hist_rec_tab.inst_last_update_login.DELETE;
l_inst_hist_rec_tab.inst_object_version_number.DELETE;
l_inst_hist_rec_tab.inst_security_group_id.DELETE;
l_inst_hist_rec_tab.inst_migrated_flag.DELETE;
l_inst_hist_rec_tab.old_network_asset_flag.DELETE;
l_inst_hist_rec_tab.new_network_asset_flag.DELETE;
l_inst_hist_rec_tab.old_maintainable_flag.DELETE;
l_inst_hist_rec_tab.new_maintainable_flag.DELETE;
l_inst_hist_rec_tab.old_pn_location_id.DELETE;
l_inst_hist_rec_tab.new_pn_location_id.DELETE;
l_inst_hist_rec_tab.old_asset_criticality_code.DELETE;
l_inst_hist_rec_tab.new_asset_criticality_code.DELETE;
l_inst_hist_rec_tab.old_category_id.DELETE;
l_inst_hist_rec_tab.new_category_id.DELETE;
l_inst_hist_rec_tab.old_equipment_gen_object_id.DELETE;
l_inst_hist_rec_tab.new_equipment_gen_object_id.DELETE;
l_inst_hist_rec_tab.old_instantiation_flag.DELETE;
l_inst_hist_rec_tab.new_instantiation_flag.DELETE;
l_inst_hist_rec_tab.old_linear_location_id.DELETE;
l_inst_hist_rec_tab.new_linear_location_id.DELETE;
l_inst_hist_rec_tab.old_operational_log_flag.DELETE;
l_inst_hist_rec_tab.new_operational_log_flag.DELETE;
l_inst_hist_rec_tab.old_checkin_status.DELETE;
l_inst_hist_rec_tab.new_checkin_status.DELETE;
l_inst_hist_rec_tab.old_supplier_warranty_exp_date.DELETE;
l_inst_hist_rec_tab.new_supplier_warranty_exp_date.DELETE;
l_inst_hist_rec_tab.old_inst_attribute16.DELETE;
l_inst_hist_rec_tab.new_inst_attribute16.DELETE;
l_inst_hist_rec_tab.old_inst_attribute17.DELETE;
l_inst_hist_rec_tab.new_inst_attribute17.DELETE;
l_inst_hist_rec_tab.old_inst_attribute18.DELETE;
l_inst_hist_rec_tab.new_inst_attribute18.DELETE;
l_inst_hist_rec_tab.old_inst_attribute19.DELETE;
l_inst_hist_rec_tab.new_inst_attribute19.DELETE;
l_inst_hist_rec_tab.old_inst_attribute20.DELETE;
l_inst_hist_rec_tab.new_inst_attribute20.DELETE;
l_inst_hist_rec_tab.old_inst_attribute21.DELETE;
l_inst_hist_rec_tab.new_inst_attribute21.DELETE;
l_inst_hist_rec_tab.old_inst_attribute22.DELETE;
l_inst_hist_rec_tab.new_inst_attribute22.DELETE;
l_inst_hist_rec_tab.old_inst_attribute23.DELETE;
l_inst_hist_rec_tab.new_inst_attribute23.DELETE;
l_inst_hist_rec_tab.old_inst_attribute24.DELETE;
l_inst_hist_rec_tab.new_inst_attribute24.DELETE;
l_inst_hist_rec_tab.old_inst_attribute25.DELETE;
l_inst_hist_rec_tab.new_inst_attribute25.DELETE;
l_inst_hist_rec_tab.old_inst_attribute26.DELETE;
l_inst_hist_rec_tab.new_inst_attribute26.DELETE;
l_inst_hist_rec_tab.old_inst_attribute27.DELETE;
l_inst_hist_rec_tab.new_inst_attribute27.DELETE;
l_inst_hist_rec_tab.old_inst_attribute28.DELETE;
l_inst_hist_rec_tab.new_inst_attribute28.DELETE;
l_inst_hist_rec_tab.old_inst_attribute29.DELETE;
l_inst_hist_rec_tab.new_inst_attribute29.DELETE;
l_inst_hist_rec_tab.old_inst_attribute30.DELETE;
l_inst_hist_rec_tab.new_inst_attribute30.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_inst_hist_rec_tab.inst_last_updated_by(l_ctr) := i.last_updated_by;
l_inst_hist_rec_tab.inst_last_update_date(l_ctr) := i.last_update_date;
l_inst_hist_rec_tab.inst_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_01
,COL_NUM_02
,COL_NUM_03
,COL_NUM_04
,COL_NUM_05
,COL_NUM_06
,COL_NUM_07
,COL_NUM_08
,COL_NUM_09
,COL_NUM_10
,COL_NUM_11
,COL_NUM_12
,COL_NUM_13
,COL_NUM_14
,COL_NUM_15
,COL_NUM_16
,COL_NUM_17
,COL_NUM_18
,COL_NUM_19
,COL_NUM_20
,COL_NUM_21
,COL_NUM_22
,COL_NUM_23
,COL_NUM_24
,COL_NUM_25
,COL_NUM_26
,COL_NUM_27
,COL_NUM_28
,COL_NUM_29
,COL_NUM_30
,COL_NUM_31
,COL_NUM_32
,COL_NUM_33
,COL_NUM_34
,COL_NUM_35
,COL_NUM_36
,COL_NUM_37 -- entity creation_by
,COL_NUM_38 -- entity last_updated_by
,COL_NUM_39 -- entity last_update_login
,COL_NUM_40 -- entity object_version_number
,COL_NUM_41 -- entity security_group_id
,COL_NUM_42 -- entity old_pn_location_id
,COL_NUM_43 -- entity new_pn_location_id
,COL_NUM_44 -- entity old_category_id
,COL_NUM_45 -- entity new_category_id
,COL_NUM_46 -- entity old_equipment_gen_object_id
,COL_NUM_47 -- entity new_equipment_gen_object_id
,COL_NUM_48 -- entity old_linear_location_id
,COL_NUM_49 -- entity new_linear_location_id
,COL_NUM_50 -- entity old_checkin_status
,COL_NUM_51 -- entity new_checkin_status
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_03
,COL_CHAR_04
,COL_CHAR_05
,COL_CHAR_06
,COL_CHAR_07
,COL_CHAR_08
,COL_CHAR_09
,COL_CHAR_10
,COL_CHAR_11
,COL_CHAR_12
,COL_CHAR_13
,COL_CHAR_14
,COL_CHAR_15
,COL_CHAR_16
,COL_CHAR_17
,COL_CHAR_18
,COL_CHAR_19
,COL_CHAR_20
,COL_CHAR_21
,COL_CHAR_22
,COL_CHAR_23
,COL_CHAR_24
,COL_CHAR_25
,COL_CHAR_26
,COL_CHAR_27
,COL_CHAR_28
,COL_CHAR_29
,COL_CHAR_30
,COL_CHAR_31 -- entity old_context
,COL_CHAR_32 -- entity new_context
,COL_CHAR_33 -- entity old_attribute1
,COL_CHAR_34 -- entity new_attribute1
,COL_CHAR_35 -- entity old_attribute2
,COL_CHAR_36 -- entity new_attribute2
,COL_CHAR_37 -- entity old_attribute3
,COL_CHAR_38 -- entity new_attribute3
,COL_CHAR_39 -- entity old_attribute4
,COL_CHAR_40 -- entity new_attribute4
,COL_CHAR_41 -- entity old_attribute5
,COL_CHAR_42 -- entity new_attribute5
,COL_CHAR_43 -- entity old_attribute6
,COL_CHAR_44 -- entity new_attribute6
,COL_CHAR_45 -- entity old_attribute7
,COL_CHAR_46 -- entity new_attribute7
,COL_CHAR_47 -- entity old_attribute8
,COL_CHAR_48 -- entity new_attribute8
,COL_CHAR_49 -- entity old_attribute9
,COL_CHAR_50 -- entity new_attribute9
,COL_CHAR_51 -- entity old_attribute10
,COL_CHAR_52 -- entity new_attribute10
,COL_CHAR_53 -- entity old_attribute11
,COL_CHAR_54 -- entity new_attribute11
,COL_CHAR_55 -- entity old_attribute12
,COL_CHAR_56 -- entity new_attribute12
,COL_CHAR_57 -- entity old_attribute13
,COL_CHAR_58 -- entity new_attribute13
,COL_CHAR_59 -- entity old_attribute14
,COL_CHAR_60 -- entity new_attribute14
,COL_CHAR_61 -- entity old_attribute15
,COL_CHAR_62 -- entity new_attribute15
,COL_CHAR_63
,COL_CHAR_64
,COL_CHAR_65
,COL_CHAR_66
,COL_CHAR_67
,COL_CHAR_68
,COL_CHAR_69
,COL_CHAR_70
,COL_CHAR_71 -- entity full_dump_flag
,COL_CHAR_72 -- entity migrated_flag
,COL_CHAR_73 -- entity old_attribute16
,COL_CHAR_74 -- entity new_attribute16
,COL_CHAR_75 -- entity old_attribute17
,COL_CHAR_76 -- entity new_attribute17
,COL_CHAR_77 -- entity old_attribute18
,COL_CHAR_78 -- entity new_attribute18
,COL_CHAR_79 -- entity old_attribute19
,COL_CHAR_80 -- entity new_attribute19
,COL_CHAR_81 -- entity old_attribute20
,COL_CHAR_82 -- entity new_attribute20
,COL_CHAR_83 -- entity old_attribute21
,COL_CHAR_84 -- entity new_attribute21
,COL_CHAR_85 -- entity old_attribute22
,COL_CHAR_86 -- entity new_attribute22
,COL_CHAR_87 -- entity old_attribute23
,COL_CHAR_88 -- entity new_attribute23
,COL_CHAR_89 -- entity old_attribute24
,COL_CHAR_90 -- entity new_attribute24
,COL_CHAR_91 -- entity old_attribute25
,COL_CHAR_92 -- entity new_attribute25
,COL_CHAR_93 -- entity old_attribute26
,COL_CHAR_94 -- entity new_attribute26
,COL_CHAR_95 -- entity old_attribute27
,COL_CHAR_96 -- entity new_attribute27
,COL_CHAR_97 -- entity old_attribute28
,COL_CHAR_98 -- entity new_attribute28
,COL_CHAR_99 -- entity old_attribute29
,COL_CHAR_100 -- entity new_attribute29
,COL_CHAR_101 -- entity old_attribute30
,COL_CHAR_102 -- entity new_attribute30
,COL_CHAR_103 -- entity old_network_asset_flag
,COL_CHAR_104 -- entity new_network_asset_flag
,COL_CHAR_105 -- entity old_maintainable_flag
,COL_CHAR_106 -- entity new_maintainable_flag
,COL_CHAR_107 -- entity old_asset_criticality_code
,COL_CHAR_108 -- entity new_asset_criticality_code
,COL_CHAR_109 -- entity old_instantiation_flag
,COL_CHAR_110 -- entity new_instantiation_flag
,COL_CHAR_111 -- entity old_operational_log_flag
,COL_CHAR_112 -- entity new_operational_log_flag
,COL_DATE_01 -- entity old_active_start_date
,COL_DATE_02 -- entity new_active_start_date
,COL_DATE_03 -- entity old_active_end_date
,COL_DATE_04 -- entity new_active_end_date
,COL_DATE_05
,COL_DATE_06
,COL_DATE_07
,COL_DATE_08
,COL_DATE_09
,COL_DATE_10
,COL_DATE_11 -- entity creation_date
,COL_DATE_12 -- entity last_update_date
,COL_DATE_13 -- entity old_supplier_warranty_exp_date
,COL_DATE_14 -- entity new_supplier_warranty_exp_date
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_inst_hist_rec_tab.instance_history_id(i),
l_inst_hist_rec_tab.transaction_id(i),
l_inst_hist_rec_tab.instance_id(i),
l_inst_hist_rec_tab.old_inventory_item_id(i),
l_inst_hist_rec_tab.new_inventory_item_id(i),
l_inst_hist_rec_tab.old_inv_master_org_id(i),
l_inst_hist_rec_tab.new_inv_master_org_id(i),
l_inst_hist_rec_tab.old_quantity(i),
l_inst_hist_rec_tab.new_quantity(i),
l_inst_hist_rec_tab.old_instance_condition_id(i),
l_inst_hist_rec_tab.new_instance_condition_id(i),
l_inst_hist_rec_tab.old_instance_status_id(i),
l_inst_hist_rec_tab.new_instance_status_id(i),
l_inst_hist_rec_tab.old_system_id(i),
l_inst_hist_rec_tab.new_system_id(i),
l_inst_hist_rec_tab.old_location_id(i),
l_inst_hist_rec_tab.new_location_id(i),
l_inst_hist_rec_tab.old_inv_organization_id(i),
l_inst_hist_rec_tab.new_inv_organization_id(i),
l_inst_hist_rec_tab.old_inv_locator_id(i),
l_inst_hist_rec_tab.new_inv_locator_id(i),
l_inst_hist_rec_tab.old_pa_project_id(i),
l_inst_hist_rec_tab.new_pa_project_id(i),
l_inst_hist_rec_tab.old_pa_project_task_id(i),
l_inst_hist_rec_tab.new_pa_project_task_id(i),
l_inst_hist_rec_tab.old_in_transit_order_line_id(i),
l_inst_hist_rec_tab.new_in_transit_order_line_id(i),
l_inst_hist_rec_tab.old_wip_job_id(i),
l_inst_hist_rec_tab.new_wip_job_id(i),
l_inst_hist_rec_tab.old_po_order_line_id(i),
l_inst_hist_rec_tab.new_po_order_line_id(i),
l_inst_hist_rec_tab.old_install_location_id(i),
l_inst_hist_rec_tab.new_install_location_id(i),
l_inst_hist_rec_tab.old_last_vld_organization_id(i),
l_inst_hist_rec_tab.new_last_vld_organization_id(i),
l_inst_hist_rec_tab.old_last_oe_agreement_id(i),
l_inst_hist_rec_tab.new_last_oe_agreement_id(i),
l_inst_hist_rec_tab.old_config_inst_rev_num(i),
l_inst_hist_rec_tab.new_config_inst_rev_num(i),
l_inst_hist_rec_tab.inst_created_by(i),
l_inst_hist_rec_tab.inst_last_updated_by(i),
l_inst_hist_rec_tab.inst_last_update_login(i),
l_inst_hist_rec_tab.inst_object_version_number(i),
l_inst_hist_rec_tab.inst_security_group_id(i),
-- Added for eam
l_inst_hist_rec_tab.old_pn_location_id(i),
l_inst_hist_rec_tab.new_pn_location_id(i),
l_inst_hist_rec_tab.old_category_id(i),
l_inst_hist_rec_tab.new_category_id(i),
l_inst_hist_rec_tab.old_equipment_gen_object_id(i),
l_inst_hist_rec_tab.new_equipment_gen_object_id(i),
l_inst_hist_rec_tab.old_linear_location_id(i),
l_inst_hist_rec_tab.new_linear_location_id(i),
l_inst_hist_rec_tab.old_checkin_status(i),
l_inst_hist_rec_tab.new_checkin_status(i),
-- End addition for eam
l_inst_hist_rec_tab.old_instance_number(i),
l_inst_hist_rec_tab.new_instance_number(i),
l_inst_hist_rec_tab.old_external_reference(i),
l_inst_hist_rec_tab.new_external_reference(i),
l_inst_hist_rec_tab.old_inventory_revision(i),
l_inst_hist_rec_tab.new_inventory_revision(i),
l_inst_hist_rec_tab.old_serial_number(i),
l_inst_hist_rec_tab.new_serial_number(i),
l_inst_hist_rec_tab.old_mfg_serial_number_flag(i),
l_inst_hist_rec_tab.new_mfg_serial_number_flag(i),
l_inst_hist_rec_tab.old_lot_number(i),
l_inst_hist_rec_tab.new_lot_number(i),
l_inst_hist_rec_tab.old_unit_of_measure(i),
l_inst_hist_rec_tab.new_unit_of_measure(i),
l_inst_hist_rec_tab.old_accounting_class_code(i),
l_inst_hist_rec_tab.new_accounting_class_code(i),
l_inst_hist_rec_tab.old_customer_view_flag(i),
l_inst_hist_rec_tab.new_customer_view_flag(i),
l_inst_hist_rec_tab.old_merchant_view_flag(i),
l_inst_hist_rec_tab.new_merchant_view_flag(i),
l_inst_hist_rec_tab.old_sellable_flag(i),
l_inst_hist_rec_tab.new_sellable_flag(i),
l_inst_hist_rec_tab.old_instance_type_code(i),
l_inst_hist_rec_tab.new_instance_type_code(i),
l_inst_hist_rec_tab.old_location_type_code(i),
l_inst_hist_rec_tab.new_location_type_code(i),
l_inst_hist_rec_tab.old_inv_subinventory_name(i),
l_inst_hist_rec_tab.new_inv_subinventory_name(i),
l_inst_hist_rec_tab.old_completeness_flag(i),
l_inst_hist_rec_tab.new_completeness_flag(i),
l_inst_hist_rec_tab.old_inst_context(i),
l_inst_hist_rec_tab.new_inst_context(i),
l_inst_hist_rec_tab.old_inst_attribute1(i),
l_inst_hist_rec_tab.new_inst_attribute1(i),
l_inst_hist_rec_tab.old_inst_attribute2(i),
l_inst_hist_rec_tab.new_inst_attribute2(i),
l_inst_hist_rec_tab.old_inst_attribute3(i),
l_inst_hist_rec_tab.new_inst_attribute3(i),
l_inst_hist_rec_tab.old_inst_attribute4(i),
l_inst_hist_rec_tab.new_inst_attribute4(i),
l_inst_hist_rec_tab.old_inst_attribute5(i),
l_inst_hist_rec_tab.new_inst_attribute5(i),
l_inst_hist_rec_tab.old_inst_attribute6(i),
l_inst_hist_rec_tab.new_inst_attribute6(i),
l_inst_hist_rec_tab.old_inst_attribute7(i),
l_inst_hist_rec_tab.new_inst_attribute7(i),
l_inst_hist_rec_tab.old_inst_attribute8(i),
l_inst_hist_rec_tab.new_inst_attribute8(i),
l_inst_hist_rec_tab.old_inst_attribute9(i),
l_inst_hist_rec_tab.new_inst_attribute9(i),
l_inst_hist_rec_tab.old_inst_attribute10(i),
l_inst_hist_rec_tab.new_inst_attribute10(i),
l_inst_hist_rec_tab.old_inst_attribute11(i),
l_inst_hist_rec_tab.new_inst_attribute11(i),
l_inst_hist_rec_tab.old_inst_attribute12(i),
l_inst_hist_rec_tab.new_inst_attribute12(i),
l_inst_hist_rec_tab.old_inst_attribute13(i),
l_inst_hist_rec_tab.new_inst_attribute13(i),
l_inst_hist_rec_tab.old_inst_attribute14(i),
l_inst_hist_rec_tab.new_inst_attribute14(i),
l_inst_hist_rec_tab.old_inst_attribute15(i),
l_inst_hist_rec_tab.new_inst_attribute15(i),
l_inst_hist_rec_tab.old_install_location_type_code(i),
l_inst_hist_rec_tab.new_install_location_type_code(i),
l_inst_hist_rec_tab.old_instance_usage_code(i),
l_inst_hist_rec_tab.new_instance_usage_code(i),
l_inst_hist_rec_tab.old_config_valid_status(i),
l_inst_hist_rec_tab.new_config_valid_status(i),
l_inst_hist_rec_tab.old_instance_description(i),
l_inst_hist_rec_tab.new_instance_description(i),
l_inst_hist_rec_tab.inst_full_dump_flag(i),
l_inst_hist_rec_tab.inst_migrated_flag(i),
-- Added for eam
l_inst_hist_rec_tab.old_inst_attribute16(i),
l_inst_hist_rec_tab.new_inst_attribute16(i),
l_inst_hist_rec_tab.old_inst_attribute17(i),
l_inst_hist_rec_tab.new_inst_attribute17(i),
l_inst_hist_rec_tab.old_inst_attribute18(i),
l_inst_hist_rec_tab.new_inst_attribute18(i),
l_inst_hist_rec_tab.old_inst_attribute19(i),
l_inst_hist_rec_tab.new_inst_attribute19(i),
l_inst_hist_rec_tab.old_inst_attribute20(i),
l_inst_hist_rec_tab.new_inst_attribute20(i),
l_inst_hist_rec_tab.old_inst_attribute21(i),
l_inst_hist_rec_tab.new_inst_attribute21(i),
l_inst_hist_rec_tab.old_inst_attribute22(i),
l_inst_hist_rec_tab.new_inst_attribute22(i),
l_inst_hist_rec_tab.old_inst_attribute23(i),
l_inst_hist_rec_tab.new_inst_attribute23(i),
l_inst_hist_rec_tab.old_inst_attribute24(i),
l_inst_hist_rec_tab.new_inst_attribute24(i),
l_inst_hist_rec_tab.old_inst_attribute25(i),
l_inst_hist_rec_tab.new_inst_attribute25(i),
l_inst_hist_rec_tab.old_inst_attribute26(i),
l_inst_hist_rec_tab.new_inst_attribute26(i),
l_inst_hist_rec_tab.old_inst_attribute27(i),
l_inst_hist_rec_tab.new_inst_attribute27(i),
l_inst_hist_rec_tab.old_inst_attribute28(i),
l_inst_hist_rec_tab.new_inst_attribute28(i),
l_inst_hist_rec_tab.old_inst_attribute29(i),
l_inst_hist_rec_tab.new_inst_attribute29(i),
l_inst_hist_rec_tab.old_inst_attribute30(i),
l_inst_hist_rec_tab.new_inst_attribute30(i),
l_inst_hist_rec_tab.old_network_asset_flag(i),
l_inst_hist_rec_tab.new_network_asset_flag(i),
l_inst_hist_rec_tab.old_maintainable_flag(i),
l_inst_hist_rec_tab.new_maintainable_flag(i),
l_inst_hist_rec_tab.old_asset_criticality_code(i),
l_inst_hist_rec_tab.new_asset_criticality_code(i),
l_inst_hist_rec_tab.old_instantiation_flag(i),
l_inst_hist_rec_tab.new_instantiation_flag(i),
l_inst_hist_rec_tab.old_operational_log_flag(i),
l_inst_hist_rec_tab.new_operational_log_flag(i),
-- End addition for eam
l_inst_hist_rec_tab.old_active_start_date(i),
l_inst_hist_rec_tab.new_active_start_date(i),
l_inst_hist_rec_tab.old_active_end_date(i),
l_inst_hist_rec_tab.new_active_end_date(i),
l_inst_hist_rec_tab.old_install_date(i),
l_inst_hist_rec_tab.new_install_date(i),
l_inst_hist_rec_tab.old_return_by_date(i),
l_inst_hist_rec_tab.new_return_by_date(i),
l_inst_hist_rec_tab.old_actual_return_date(i),
l_inst_hist_rec_tab.new_actual_return_date(i),
l_inst_hist_rec_tab.inst_creation_date(i),
l_inst_hist_rec_tab.inst_last_update_date(i),
-- Added for eam
l_inst_hist_rec_tab.old_supplier_warranty_exp_date(i),
l_inst_hist_rec_tab.new_supplier_warranty_exp_date(i),
-- End addition for eam
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_ITEM_INSTANCES_H
Where instance_history_id = l_inst_hist_rec_tab.instance_history_id(i);
Update CSI_ITEM_INSTANCES
Set last_purge_date = to_date(purge_to_date,'YYYY/MM/DD HH24:MI:SS')
Where instance_id = l_inst_hist_rec_tab.instance_id(i);
Select csh.*
From CSI_I_PARTIES_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_I_PARTIES_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_pty_hist_rec_tab.instance_party_history_id.DELETE;
l_pty_hist_rec_tab.instance_party_id.DELETE;
l_pty_hist_rec_tab.transaction_id.DELETE;
l_pty_hist_rec_tab.old_party_source_table.DELETE;
l_pty_hist_rec_tab.new_party_source_table.DELETE;
l_pty_hist_rec_tab.old_party_id.DELETE;
l_pty_hist_rec_tab.new_party_id.DELETE;
l_pty_hist_rec_tab.old_relationship_type_code.DELETE;
l_pty_hist_rec_tab.new_relationship_type_code.DELETE;
l_pty_hist_rec_tab.old_contact_flag.DELETE;
l_pty_hist_rec_tab.new_contact_flag.DELETE;
l_pty_hist_rec_tab.old_contact_ip_id.DELETE;
l_pty_hist_rec_tab.new_contact_ip_id.DELETE;
l_pty_hist_rec_tab.old_active_start_date.DELETE;
l_pty_hist_rec_tab.new_active_start_date.DELETE;
l_pty_hist_rec_tab.old_active_end_date.DELETE;
l_pty_hist_rec_tab.new_active_end_date.DELETE;
l_pty_hist_rec_tab.old_context.DELETE;
l_pty_hist_rec_tab.new_context.DELETE;
l_pty_hist_rec_tab.old_attribute1.DELETE;
l_pty_hist_rec_tab.new_attribute1.DELETE;
l_pty_hist_rec_tab.old_attribute2.DELETE;
l_pty_hist_rec_tab.new_attribute2.DELETE;
l_pty_hist_rec_tab.old_attribute3.DELETE;
l_pty_hist_rec_tab.new_attribute3.DELETE;
l_pty_hist_rec_tab.old_attribute4.DELETE;
l_pty_hist_rec_tab.new_attribute4.DELETE;
l_pty_hist_rec_tab.old_attribute5.DELETE;
l_pty_hist_rec_tab.new_attribute5.DELETE;
l_pty_hist_rec_tab.old_attribute6.DELETE;
l_pty_hist_rec_tab.new_attribute6.DELETE;
l_pty_hist_rec_tab.old_attribute7.DELETE;
l_pty_hist_rec_tab.new_attribute7.DELETE;
l_pty_hist_rec_tab.old_attribute8.DELETE;
l_pty_hist_rec_tab.new_attribute8.DELETE;
l_pty_hist_rec_tab.old_attribute9.DELETE;
l_pty_hist_rec_tab.new_attribute9.DELETE;
l_pty_hist_rec_tab.old_attribute10.DELETE;
l_pty_hist_rec_tab.new_attribute10.DELETE;
l_pty_hist_rec_tab.old_attribute11.DELETE;
l_pty_hist_rec_tab.new_attribute11.DELETE;
l_pty_hist_rec_tab.old_attribute12.DELETE;
l_pty_hist_rec_tab.new_attribute12.DELETE;
l_pty_hist_rec_tab.old_attribute13.DELETE;
l_pty_hist_rec_tab.new_attribute13.DELETE;
l_pty_hist_rec_tab.old_attribute14.DELETE;
l_pty_hist_rec_tab.new_attribute14.DELETE;
l_pty_hist_rec_tab.old_attribute15.DELETE;
l_pty_hist_rec_tab.new_attribute15.DELETE;
l_pty_hist_rec_tab.old_preferred_flag.DELETE;
l_pty_hist_rec_tab.new_preferred_flag.DELETE;
l_pty_hist_rec_tab.old_primary_flag.DELETE;
l_pty_hist_rec_tab.new_primary_flag.DELETE;
l_pty_hist_rec_tab.pty_full_dump_flag.DELETE;
l_pty_hist_rec_tab.pty_created_by.DELETE;
l_pty_hist_rec_tab.pty_creation_date.DELETE;
l_pty_hist_rec_tab.pty_last_updated_by.DELETE;
l_pty_hist_rec_tab.pty_last_update_date.DELETE;
l_pty_hist_rec_tab.pty_last_update_login.DELETE;
l_pty_hist_rec_tab.pty_object_version_number.DELETE;
l_pty_hist_rec_tab.pty_security_group_id.DELETE;
l_pty_hist_rec_tab.pty_migrated_flag.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_pty_hist_rec_tab.pty_last_updated_by(l_ctr) := i.last_updated_by;
l_pty_hist_rec_tab.pty_last_update_date(l_ctr) := i.last_update_date;
l_pty_hist_rec_tab.pty_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_01
,COL_NUM_02
,COL_NUM_03
,COL_NUM_04
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_03
,COL_CHAR_04
,COL_CHAR_05
,COL_CHAR_06
,COL_CHAR_07
,COL_CHAR_08
,COL_CHAR_09
,COL_CHAR_10
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_pty_hist_rec_tab.instance_party_history_id(i),
l_pty_hist_rec_tab.transaction_id(i),
l_pty_hist_rec_tab.instance_party_id(i),
l_pty_hist_rec_tab.old_party_id(i),
l_pty_hist_rec_tab.new_party_id(i),
l_pty_hist_rec_tab.old_contact_ip_id(i),
l_pty_hist_rec_tab.new_contact_ip_id(i),
l_pty_hist_rec_tab.pty_created_by(i),
l_pty_hist_rec_tab.pty_last_updated_by(i),
l_pty_hist_rec_tab.pty_last_update_login(i),
l_pty_hist_rec_tab.pty_object_version_number(i),
l_pty_hist_rec_tab.pty_security_group_id(i),
l_pty_hist_rec_tab.old_party_source_table(i),
l_pty_hist_rec_tab.new_party_source_table(i),
l_pty_hist_rec_tab.old_relationship_type_code(i),
l_pty_hist_rec_tab.new_relationship_type_code(i),
l_pty_hist_rec_tab.old_contact_flag(i),
l_pty_hist_rec_tab.new_contact_flag(i),
l_pty_hist_rec_tab.old_preferred_flag(i),
l_pty_hist_rec_tab.new_preferred_flag(i),
l_pty_hist_rec_tab.old_primary_flag(i),
l_pty_hist_rec_tab.new_primary_flag(i),
l_pty_hist_rec_tab.old_context(i),
l_pty_hist_rec_tab.new_context(i),
l_pty_hist_rec_tab.old_attribute1(i),
l_pty_hist_rec_tab.new_attribute1(i),
l_pty_hist_rec_tab.old_attribute2(i),
l_pty_hist_rec_tab.new_attribute2(i),
l_pty_hist_rec_tab.old_attribute3(i),
l_pty_hist_rec_tab.new_attribute3(i),
l_pty_hist_rec_tab.old_attribute4(i),
l_pty_hist_rec_tab.new_attribute4(i),
l_pty_hist_rec_tab.old_attribute5(i),
l_pty_hist_rec_tab.new_attribute5(i),
l_pty_hist_rec_tab.old_attribute6(i),
l_pty_hist_rec_tab.new_attribute6(i),
l_pty_hist_rec_tab.old_attribute7(i),
l_pty_hist_rec_tab.new_attribute7(i),
l_pty_hist_rec_tab.old_attribute8(i),
l_pty_hist_rec_tab.new_attribute8(i),
l_pty_hist_rec_tab.old_attribute9(i),
l_pty_hist_rec_tab.new_attribute9(i),
l_pty_hist_rec_tab.old_attribute10(i),
l_pty_hist_rec_tab.new_attribute10(i),
l_pty_hist_rec_tab.old_attribute11(i),
l_pty_hist_rec_tab.new_attribute11(i),
l_pty_hist_rec_tab.old_attribute12(i),
l_pty_hist_rec_tab.new_attribute12(i),
l_pty_hist_rec_tab.old_attribute13(i),
l_pty_hist_rec_tab.new_attribute13(i),
l_pty_hist_rec_tab.old_attribute14(i),
l_pty_hist_rec_tab.new_attribute14(i),
l_pty_hist_rec_tab.old_attribute15(i),
l_pty_hist_rec_tab.new_attribute15(i),
l_pty_hist_rec_tab.pty_full_dump_flag(i),
l_pty_hist_rec_tab.pty_migrated_flag(i),
l_pty_hist_rec_tab.old_active_start_date(i),
l_pty_hist_rec_tab.new_active_start_date(i),
l_pty_hist_rec_tab.old_active_end_date(i),
l_pty_hist_rec_tab.new_active_end_date(i),
l_pty_hist_rec_tab.pty_creation_date(i),
l_pty_hist_rec_tab.pty_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_I_PARTIES_H
Where instance_party_history_id = l_pty_hist_rec_tab.instance_party_history_id(i);
Select csh.*
From CSI_IP_ACCOUNTS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_IP_ACCOUNTS_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_acct_hist_rec_tab.ip_account_history_id.DELETE;
l_acct_hist_rec_tab.ip_account_id.DELETE;
l_acct_hist_rec_tab.transaction_id.DELETE;
l_acct_hist_rec_tab.old_party_account_id.DELETE;
l_acct_hist_rec_tab.new_party_account_id.DELETE;
l_acct_hist_rec_tab.old_relationship_type_code.DELETE;
l_acct_hist_rec_tab.new_relationship_type_code.DELETE;
l_acct_hist_rec_tab.old_bill_to_address.DELETE;
l_acct_hist_rec_tab.new_bill_to_address.DELETE;
l_acct_hist_rec_tab.old_ship_to_address.DELETE;
l_acct_hist_rec_tab.new_ship_to_address.DELETE;
l_acct_hist_rec_tab.old_active_start_date.DELETE;
l_acct_hist_rec_tab.new_active_start_date.DELETE;
l_acct_hist_rec_tab.old_active_end_date.DELETE;
l_acct_hist_rec_tab.new_active_end_date.DELETE;
l_acct_hist_rec_tab.old_context.DELETE;
l_acct_hist_rec_tab.new_context.DELETE;
l_acct_hist_rec_tab.old_attribute1.DELETE;
l_acct_hist_rec_tab.new_attribute1.DELETE;
l_acct_hist_rec_tab.old_attribute2.DELETE;
l_acct_hist_rec_tab.new_attribute2.DELETE;
l_acct_hist_rec_tab.old_attribute3.DELETE;
l_acct_hist_rec_tab.new_attribute3.DELETE;
l_acct_hist_rec_tab.old_attribute4.DELETE;
l_acct_hist_rec_tab.new_attribute4.DELETE;
l_acct_hist_rec_tab.old_attribute5.DELETE;
l_acct_hist_rec_tab.new_attribute5.DELETE;
l_acct_hist_rec_tab.old_attribute6.DELETE;
l_acct_hist_rec_tab.new_attribute6.DELETE;
l_acct_hist_rec_tab.old_attribute7.DELETE;
l_acct_hist_rec_tab.new_attribute7.DELETE;
l_acct_hist_rec_tab.old_attribute8.DELETE;
l_acct_hist_rec_tab.new_attribute8.DELETE;
l_acct_hist_rec_tab.old_attribute9.DELETE;
l_acct_hist_rec_tab.new_attribute9.DELETE;
l_acct_hist_rec_tab.old_attribute10.DELETE;
l_acct_hist_rec_tab.new_attribute10.DELETE;
l_acct_hist_rec_tab.old_attribute11.DELETE;
l_acct_hist_rec_tab.new_attribute11.DELETE;
l_acct_hist_rec_tab.old_attribute12.DELETE;
l_acct_hist_rec_tab.new_attribute12.DELETE;
l_acct_hist_rec_tab.old_attribute13.DELETE;
l_acct_hist_rec_tab.new_attribute13.DELETE;
l_acct_hist_rec_tab.old_attribute14.DELETE;
l_acct_hist_rec_tab.new_attribute14.DELETE;
l_acct_hist_rec_tab.old_attribute15.DELETE;
l_acct_hist_rec_tab.new_attribute15.DELETE;
l_acct_hist_rec_tab.acct_full_dump_flag.DELETE;
l_acct_hist_rec_tab.acct_created_by.DELETE;
l_acct_hist_rec_tab.acct_creation_date.DELETE;
l_acct_hist_rec_tab.acct_last_updated_by.DELETE;
l_acct_hist_rec_tab.acct_last_update_date.DELETE;
l_acct_hist_rec_tab.acct_last_update_login.DELETE;
l_acct_hist_rec_tab.acct_object_version_number.DELETE;
l_acct_hist_rec_tab.acct_security_group_id.DELETE;
l_acct_hist_rec_tab.acct_migrated_flag.DELETE;
l_acct_hist_rec_tab.old_instance_party_id.DELETE;
l_acct_hist_rec_tab.new_instance_party_id.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_acct_hist_rec_tab.acct_last_updated_by(l_ctr) := i.last_updated_by;
l_acct_hist_rec_tab.acct_last_update_date(l_ctr) := i.last_update_date;
l_acct_hist_rec_tab.acct_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_01
,COL_NUM_02
,COL_NUM_03
,COL_NUM_04
,COL_NUM_05
,COL_NUM_06
,COL_NUM_07
,COL_NUM_08
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_acct_hist_rec_tab.ip_account_history_id(i),
l_acct_hist_rec_tab.transaction_id(i),
l_acct_hist_rec_tab.ip_account_id(i),
l_acct_hist_rec_tab.old_party_account_id(i),
l_acct_hist_rec_tab.new_party_account_id(i),
l_acct_hist_rec_tab.old_bill_to_address(i),
l_acct_hist_rec_tab.new_bill_to_address(i),
l_acct_hist_rec_tab.old_ship_to_address(i),
l_acct_hist_rec_tab.new_ship_to_address(i),
l_acct_hist_rec_tab.old_instance_party_id(i),
l_acct_hist_rec_tab.new_instance_party_id(i),
l_acct_hist_rec_tab.acct_created_by(i),
l_acct_hist_rec_tab.acct_last_updated_by(i),
l_acct_hist_rec_tab.acct_last_update_login(i),
l_acct_hist_rec_tab.acct_object_version_number(i), -- obj_ver_num
l_acct_hist_rec_tab.acct_security_group_id(i), -- sec_grp_id
l_acct_hist_rec_tab.old_relationship_type_code(i),
l_acct_hist_rec_tab.new_relationship_type_code(i),
l_acct_hist_rec_tab.old_context(i),
l_acct_hist_rec_tab.new_context(i),
l_acct_hist_rec_tab.old_attribute1(i),
l_acct_hist_rec_tab.new_attribute1(i),
l_acct_hist_rec_tab.old_attribute2(i),
l_acct_hist_rec_tab.new_attribute2(i),
l_acct_hist_rec_tab.old_attribute3(i),
l_acct_hist_rec_tab.new_attribute3(i),
l_acct_hist_rec_tab.old_attribute4(i),
l_acct_hist_rec_tab.new_attribute4(i),
l_acct_hist_rec_tab.old_attribute5(i),
l_acct_hist_rec_tab.new_attribute5(i),
l_acct_hist_rec_tab.old_attribute6(i),
l_acct_hist_rec_tab.new_attribute6(i),
l_acct_hist_rec_tab.old_attribute7(i),
l_acct_hist_rec_tab.new_attribute7(i),
l_acct_hist_rec_tab.old_attribute8(i),
l_acct_hist_rec_tab.new_attribute8(i),
l_acct_hist_rec_tab.old_attribute9(i),
l_acct_hist_rec_tab.new_attribute9(i),
l_acct_hist_rec_tab.old_attribute10(i),
l_acct_hist_rec_tab.new_attribute10(i),
l_acct_hist_rec_tab.old_attribute11(i),
l_acct_hist_rec_tab.new_attribute11(i),
l_acct_hist_rec_tab.old_attribute12(i),
l_acct_hist_rec_tab.new_attribute12(i),
l_acct_hist_rec_tab.old_attribute13(i),
l_acct_hist_rec_tab.new_attribute13(i),
l_acct_hist_rec_tab.old_attribute14(i),
l_acct_hist_rec_tab.new_attribute14(i),
l_acct_hist_rec_tab.old_attribute15(i),
l_acct_hist_rec_tab.new_attribute15(i),
l_acct_hist_rec_tab.acct_full_dump_flag(i), --'N', dump_flag
l_acct_hist_rec_tab.acct_migrated_flag(i), -- mig_flag
l_acct_hist_rec_tab.old_active_start_date(i),
l_acct_hist_rec_tab.new_active_start_date(i),
l_acct_hist_rec_tab.old_active_end_date(i),
l_acct_hist_rec_tab.new_active_end_date(i),
l_acct_hist_rec_tab.acct_creation_date(i),
l_acct_hist_rec_tab.acct_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_IP_ACCOUNTS_H
Where ip_account_history_id = l_acct_hist_rec_tab.ip_account_history_id(i);
Select csh.*
From CSI_I_ORG_ASSIGNMENTS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_I_ORG_ASSIGNMENTS_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_org_units_hist_rec_tab.instance_ou_history_id.DELETE;
l_org_units_hist_rec_tab.instance_ou_id.DELETE;
l_org_units_hist_rec_tab.transaction_id.DELETE;
l_org_units_hist_rec_tab.old_operating_unit_id.DELETE;
l_org_units_hist_rec_tab.new_operating_unit_id.DELETE;
l_org_units_hist_rec_tab.old_ou_relnship_type_code.DELETE;
l_org_units_hist_rec_tab.new_ou_relnship_type_code.DELETE;
l_org_units_hist_rec_tab.old_ou_active_start_date.DELETE;
l_org_units_hist_rec_tab.new_ou_active_start_date.DELETE;
l_org_units_hist_rec_tab.old_ou_active_end_date.DELETE;
l_org_units_hist_rec_tab.new_ou_active_end_date.DELETE;
l_org_units_hist_rec_tab.old_ou_context.DELETE;
l_org_units_hist_rec_tab.new_ou_context.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute1.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute1.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute2.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute2.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute3.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute3.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute4.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute4.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute5.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute5.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute6.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute6.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute7.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute7.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute8.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute8.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute9.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute9.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute10.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute10.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute11.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute11.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute12.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute12.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute13.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute13.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute14.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute14.DELETE;
l_org_units_hist_rec_tab.old_ou_attribute15.DELETE;
l_org_units_hist_rec_tab.new_ou_attribute15.DELETE;
l_org_units_hist_rec_tab.ou_full_dump_flag.DELETE;
l_org_units_hist_rec_tab.ou_created_by.DELETE;
l_org_units_hist_rec_tab.ou_creation_date.DELETE;
l_org_units_hist_rec_tab.ou_last_updated_by.DELETE;
l_org_units_hist_rec_tab.ou_last_update_date.DELETE;
l_org_units_hist_rec_tab.ou_last_update_login.DELETE;
l_org_units_hist_rec_tab.ou_object_version_number.DELETE;
l_org_units_hist_rec_tab.ou_security_group_id.DELETE;
l_org_units_hist_rec_tab.ou_migrated_flag.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_org_units_hist_rec_tab.ou_last_updated_by(l_ctr) := i.last_updated_by;
l_org_units_hist_rec_tab.ou_last_update_date(l_ctr) := i.last_update_date;
l_org_units_hist_rec_tab.ou_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_01
,COL_NUM_02
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_org_units_hist_rec_tab.instance_ou_history_id(i),
l_org_units_hist_rec_tab.transaction_id(i),
l_org_units_hist_rec_tab.instance_ou_id(i),
l_org_units_hist_rec_tab.old_operating_unit_id(i),
l_org_units_hist_rec_tab.new_operating_unit_id(i),
l_org_units_hist_rec_tab.ou_created_by(i),
l_org_units_hist_rec_tab.ou_last_updated_by(i),
l_org_units_hist_rec_tab.ou_last_update_login(i),
l_org_units_hist_rec_tab.ou_object_version_number(i), -- obj_ver_num
l_org_units_hist_rec_tab.ou_security_group_id(i), -- sec_grp_id
l_org_units_hist_rec_tab.old_ou_relnship_type_code(i),
l_org_units_hist_rec_tab.new_ou_relnship_type_code(i),
l_org_units_hist_rec_tab.old_ou_context(i),
l_org_units_hist_rec_tab.new_ou_context(i),
l_org_units_hist_rec_tab.old_ou_attribute1(i),
l_org_units_hist_rec_tab.new_ou_attribute1(i),
l_org_units_hist_rec_tab.old_ou_attribute2(i),
l_org_units_hist_rec_tab.new_ou_attribute2(i),
l_org_units_hist_rec_tab.old_ou_attribute3(i),
l_org_units_hist_rec_tab.new_ou_attribute3(i),
l_org_units_hist_rec_tab.old_ou_attribute4(i),
l_org_units_hist_rec_tab.new_ou_attribute4(i),
l_org_units_hist_rec_tab.old_ou_attribute5(i),
l_org_units_hist_rec_tab.new_ou_attribute5(i),
l_org_units_hist_rec_tab.old_ou_attribute6(i),
l_org_units_hist_rec_tab.new_ou_attribute6(i),
l_org_units_hist_rec_tab.old_ou_attribute7(i),
l_org_units_hist_rec_tab.new_ou_attribute7(i),
l_org_units_hist_rec_tab.old_ou_attribute8(i),
l_org_units_hist_rec_tab.new_ou_attribute8(i),
l_org_units_hist_rec_tab.old_ou_attribute9(i),
l_org_units_hist_rec_tab.new_ou_attribute9(i),
l_org_units_hist_rec_tab.old_ou_attribute10(i),
l_org_units_hist_rec_tab.new_ou_attribute10(i),
l_org_units_hist_rec_tab.old_ou_attribute11(i),
l_org_units_hist_rec_tab.new_ou_attribute11(i),
l_org_units_hist_rec_tab.old_ou_attribute12(i),
l_org_units_hist_rec_tab.new_ou_attribute12(i),
l_org_units_hist_rec_tab.old_ou_attribute13(i),
l_org_units_hist_rec_tab.new_ou_attribute13(i),
l_org_units_hist_rec_tab.old_ou_attribute14(i),
l_org_units_hist_rec_tab.new_ou_attribute14(i),
l_org_units_hist_rec_tab.old_ou_attribute15(i),
l_org_units_hist_rec_tab.new_ou_attribute15(i),
l_org_units_hist_rec_tab.ou_full_dump_flag(i), --'N', dump_flag
l_org_units_hist_rec_tab.ou_migrated_flag(i), -- mig_flag
l_org_units_hist_rec_tab.old_ou_active_start_date(i),
l_org_units_hist_rec_tab.new_ou_active_start_date(i),
l_org_units_hist_rec_tab.old_ou_active_end_date(i),
l_org_units_hist_rec_tab.new_ou_active_end_date(i),
l_org_units_hist_rec_tab.ou_creation_date(i),
l_org_units_hist_rec_tab.ou_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_I_ORG_ASSIGNMENTS_H
Where instance_ou_history_id = l_org_units_hist_rec_tab.instance_ou_history_id(i);
Select csh.*
From CSI_IEA_VALUES_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_IEA_VALUES_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_ext_attrib_hist_rec_tab.attribute_value_history_id.DELETE;
l_ext_attrib_hist_rec_tab.attribute_value_id.DELETE;
l_ext_attrib_hist_rec_tab.transaction_id.DELETE;
l_ext_attrib_hist_rec_tab.old_attribute_value.DELETE;
l_ext_attrib_hist_rec_tab.new_attribute_value.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_active_start_date.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_active_start_date.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_active_end_date.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_active_end_date.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_context.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_context.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute1.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute1.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute2.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute2.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute3.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute3.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute4.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute4.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute5.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute5.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute6.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute6.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute7.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute7.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute8.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute8.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute9.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute9.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute10.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute10.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute11.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute11.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute12.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute12.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute13.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute13.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute14.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute14.DELETE;
l_ext_attrib_hist_rec_tab.old_ext_attribute15.DELETE;
l_ext_attrib_hist_rec_tab.new_ext_attribute15.DELETE;
l_ext_attrib_hist_rec_tab.ext_full_dump_flag.DELETE;
l_ext_attrib_hist_rec_tab.ext_created_by.DELETE;
l_ext_attrib_hist_rec_tab.ext_creation_date.DELETE;
l_ext_attrib_hist_rec_tab.ext_last_updated_by.DELETE;
l_ext_attrib_hist_rec_tab.ext_last_update_date.DELETE;
l_ext_attrib_hist_rec_tab.ext_last_update_login.DELETE;
l_ext_attrib_hist_rec_tab.ext_object_version_number.DELETE;
l_ext_attrib_hist_rec_tab.ext_security_group_id.DELETE;
l_ext_attrib_hist_rec_tab.ext_migrated_flag.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_ext_attrib_hist_rec_tab.ext_last_updated_by(l_ctr) := i.last_updated_by;
l_ext_attrib_hist_rec_tab.ext_last_update_date(l_ctr) := i.last_update_date;
l_ext_attrib_hist_rec_tab.ext_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_ext_attrib_hist_rec_tab.attribute_value_history_id(i),
l_ext_attrib_hist_rec_tab.transaction_id(i),
l_ext_attrib_hist_rec_tab.attribute_value_id(i),
l_ext_attrib_hist_rec_tab.ext_created_by(i),
l_ext_attrib_hist_rec_tab.ext_last_updated_by(i),
l_ext_attrib_hist_rec_tab.ext_last_update_login(i),
l_ext_attrib_hist_rec_tab.ext_object_version_number(i), -- obj_ver_num
l_ext_attrib_hist_rec_tab.ext_security_group_id(i),
l_ext_attrib_hist_rec_tab.old_attribute_value(i),
l_ext_attrib_hist_rec_tab.new_attribute_value(i),
l_ext_attrib_hist_rec_tab.old_ext_context(i),
l_ext_attrib_hist_rec_tab.new_ext_context(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute1(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute1(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute2(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute2(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute3(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute3(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute4(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute4(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute5(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute5(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute6(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute6(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute7(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute7(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute8(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute8(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute9(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute9(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute10(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute10(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute11(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute11(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute12(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute12(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute13(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute13(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute14(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute14(i),
l_ext_attrib_hist_rec_tab.old_ext_attribute15(i),
l_ext_attrib_hist_rec_tab.new_ext_attribute15(i),
l_ext_attrib_hist_rec_tab.ext_full_dump_flag(i), --'N', dump_flag
l_ext_attrib_hist_rec_tab.ext_migrated_flag(i), -- mig_flag
l_ext_attrib_hist_rec_tab.old_ext_active_start_date(i),
l_ext_attrib_hist_rec_tab.new_ext_active_start_date(i),
l_ext_attrib_hist_rec_tab.old_ext_active_end_date(i),
l_ext_attrib_hist_rec_tab.new_ext_active_end_date(i),
l_ext_attrib_hist_rec_tab.ext_creation_date(i),
l_ext_attrib_hist_rec_tab.ext_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_IEA_VALUES_H
Where attribute_value_history_id = l_ext_attrib_hist_rec_tab.attribute_value_history_id(i);
Select csh.*
From CSI_I_PRICING_ATTRIBS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_I_PRICING_ATTRIBS_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_pri_attribs_hist_rec_tab.price_attrib_history_id.DELETE;
l_pri_attribs_hist_rec_tab.pricing_attribute_id.DELETE;
l_pri_attribs_hist_rec_tab.transaction_id.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_context.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_context.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute1.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute1.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute2.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute2.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute3.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute3.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute4.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute4.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute5.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute5.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute6.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute6.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute7.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute7.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute8.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute8.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute9.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute9.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute10.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute10.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute11.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute11.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute12.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute12.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute13.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute13.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute14.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute14.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute15.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute15.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute16.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute16.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute17.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute17.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute18.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute18.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute19.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute19.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute20.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute20.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute21.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute21.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute22.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute22.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute23.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute23.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute24.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute24.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute25.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute25.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute26.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute26.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute27.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute27.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute28.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute28.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute29.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute29.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute30.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute30.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute31.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute31.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute32.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute32.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute33.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute33.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute34.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute34.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute35.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute35.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute36.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute36.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute37.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute37.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute38.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute38.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute39.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute39.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute40.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute40.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute41.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute41.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute42.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute42.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute43.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute43.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute44.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute44.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute45.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute45.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute46.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute46.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute47.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute47.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute48.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute48.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute49.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute49.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute50.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute50.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute51.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute51.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute52.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute52.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute53.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute53.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute54.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute54.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute55.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute55.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute56.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute56.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute57.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute57.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute58.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute58.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute59.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute59.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute60.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute60.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute61.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute61.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute62.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute62.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute63.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute63.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute64.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute64.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute65.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute65.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute66.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute66.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute67.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute67.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute68.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute68.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute69.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute69.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute70.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute70.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute71.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute71.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute72.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute72.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute73.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute73.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute74.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute74.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute75.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute75.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute76.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute76.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute77.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute77.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute78.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute78.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute79.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute79.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute80.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute80.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute81.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute81.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute82.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute82.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute83.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute83.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute84.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute84.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute85.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute85.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute86.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute86.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute87.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute87.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute88.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute88.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute89.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute89.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute90.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute90.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute91.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute91.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute92.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute92.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute93.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute93.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute94.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute94.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute95.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute95.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute96.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute96.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute97.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute97.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute98.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute98.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute99.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute99.DELETE;
l_pri_attribs_hist_rec_tab.old_pricing_attribute100.DELETE;
l_pri_attribs_hist_rec_tab.new_pricing_attribute100.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_active_start_date.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_active_start_date.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_active_end_date.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_active_end_date.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_context.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_context.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute1.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute1.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute2.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute2.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute3.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute3.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute4.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute4.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute5.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute5.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute6.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute6.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute7.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute7.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute8.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute8.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute9.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute9.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute10.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute10.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute11.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute11.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute12.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute12.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute13.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute13.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute14.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute14.DELETE;
l_pri_attribs_hist_rec_tab.old_pri_attribute15.DELETE;
l_pri_attribs_hist_rec_tab.new_pri_attribute15.DELETE;
l_pri_attribs_hist_rec_tab.pri_full_dump_flag.DELETE;
l_pri_attribs_hist_rec_tab.pri_created_by.DELETE;
l_pri_attribs_hist_rec_tab.pri_creation_date.DELETE;
l_pri_attribs_hist_rec_tab.pri_last_updated_by.DELETE;
l_pri_attribs_hist_rec_tab.pri_last_update_date.DELETE;
l_pri_attribs_hist_rec_tab.pri_last_update_login.DELETE;
l_pri_attribs_hist_rec_tab.pri_object_version_number.DELETE;
l_pri_attribs_hist_rec_tab.pri_security_group_id.DELETE;
l_pri_attribs_hist_rec_tab.pri_migrated_flag.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_pri_attribs_hist_rec_tab.pri_last_updated_by(l_ctr) := i.last_updated_by;
l_pri_attribs_hist_rec_tab.pri_last_update_date(l_ctr) := i.last_update_date;
l_pri_attribs_hist_rec_tab.pri_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_03
,COL_CHAR_04
,COL_CHAR_05
,COL_CHAR_06
,COL_CHAR_07
,COL_CHAR_08
,COL_CHAR_09
,COL_CHAR_10
,COL_CHAR_11
,COL_CHAR_12
,COL_CHAR_13
,COL_CHAR_14
,COL_CHAR_15
,COL_CHAR_16
,COL_CHAR_17
,COL_CHAR_18
,COL_CHAR_19
,COL_CHAR_20
,COL_CHAR_21
,COL_CHAR_22
,COL_CHAR_23
,COL_CHAR_24
,COL_CHAR_25
,COL_CHAR_26
,COL_CHAR_27
,COL_CHAR_28
,COL_CHAR_29
,COL_CHAR_30
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_63
,COL_CHAR_64
,COL_CHAR_65
,COL_CHAR_66
,COL_CHAR_67
,COL_CHAR_68
,COL_CHAR_69
,COL_CHAR_70
,COL_CHAR_71
,COL_CHAR_72
,COL_CHAR_73
,COL_CHAR_74
,COL_CHAR_75
,COL_CHAR_76
,COL_CHAR_77
,COL_CHAR_78
,COL_CHAR_79
,COL_CHAR_80
,COL_CHAR_81
,COL_CHAR_82
,COL_CHAR_83
,COL_CHAR_84
,COL_CHAR_85
,COL_CHAR_86
,COL_CHAR_87
,COL_CHAR_88
,COL_CHAR_89
,COL_CHAR_90
,COL_CHAR_91
,COL_CHAR_92
,COL_CHAR_93
,COL_CHAR_94
,COL_CHAR_95
,COL_CHAR_96
,COL_CHAR_97
,COL_CHAR_98
,COL_CHAR_99
,COL_CHAR_100
,COL_CHAR_101
,COL_CHAR_102
,COL_CHAR_103
,COL_CHAR_104
,COL_CHAR_105
,COL_CHAR_106
,COL_CHAR_107
,COL_CHAR_108
,COL_CHAR_109
,COL_CHAR_110
,COL_CHAR_111
,COL_CHAR_112
,COL_CHAR_113
,COL_CHAR_114
,COL_CHAR_115
,COL_CHAR_116
,COL_CHAR_117
,COL_CHAR_118
,COL_CHAR_119
,COL_CHAR_120
,COL_CHAR_121
,COL_CHAR_122
,COL_CHAR_123
,COL_CHAR_124
,COL_CHAR_125
,COL_CHAR_126
,COL_CHAR_127
,COL_CHAR_128
,COL_CHAR_129
,COL_CHAR_130
,COL_CHAR_131
,COL_CHAR_132
,COL_CHAR_133
,COL_CHAR_134
,COL_CHAR_135
,COL_CHAR_136
,COL_CHAR_137
,COL_CHAR_138
,COL_CHAR_139
,COL_CHAR_140
,COL_CHAR_141
,COL_CHAR_142
,COL_CHAR_143
,COL_CHAR_144
,COL_CHAR_145
,COL_CHAR_146
,COL_CHAR_147
,COL_CHAR_148
,COL_CHAR_149
,COL_CHAR_150
,COL_CHAR_151
,COL_CHAR_152
,COL_CHAR_153
,COL_CHAR_154
,COL_CHAR_155
,COL_CHAR_156
,COL_CHAR_157
,COL_CHAR_158
,COL_CHAR_159
,COL_CHAR_160
,COL_CHAR_161
,COL_CHAR_162
,COL_CHAR_163
,COL_CHAR_164
,COL_CHAR_165
,COL_CHAR_166
,COL_CHAR_167
,COL_CHAR_168
,COL_CHAR_169
,COL_CHAR_170
,COL_CHAR_171
,COL_CHAR_172
,COL_CHAR_173
,COL_CHAR_174
,COL_CHAR_175
,COL_CHAR_176
,COL_CHAR_177
,COL_CHAR_178
,COL_CHAR_179
,COL_CHAR_180
,COL_CHAR_181
,COL_CHAR_182
,COL_CHAR_183
,COL_CHAR_184
,COL_CHAR_185
,COL_CHAR_186
,COL_CHAR_187
,COL_CHAR_188
,COL_CHAR_189
,COL_CHAR_190
,COL_CHAR_191
,COL_CHAR_192
,COL_CHAR_193
,COL_CHAR_194
,COL_CHAR_195
,COL_CHAR_196
,COL_CHAR_197
,COL_CHAR_198
,COL_CHAR_199
,COL_CHAR_200
,COL_CHAR_201
,COL_CHAR_202
,COL_CHAR_203
,COL_CHAR_204
,COL_CHAR_205
,COL_CHAR_206
,COL_CHAR_207
,COL_CHAR_208
,COL_CHAR_209
,COL_CHAR_210
,COL_CHAR_211
,COL_CHAR_212
,COL_CHAR_213
,COL_CHAR_214
,COL_CHAR_215
,COL_CHAR_216
,COL_CHAR_217
,COL_CHAR_218
,COL_CHAR_219
,COL_CHAR_220
,COL_CHAR_221
,COL_CHAR_222
,COL_CHAR_223
,COL_CHAR_224
,COL_CHAR_225
,COL_CHAR_226
,COL_CHAR_227
,COL_CHAR_228
,COL_CHAR_229
,COL_CHAR_230
,COL_CHAR_231
,COL_CHAR_232
,COL_CHAR_233
,COL_CHAR_234
,COL_CHAR_235
,COL_CHAR_236
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_pri_attribs_hist_rec_tab.price_attrib_history_id(i),
l_pri_attribs_hist_rec_tab.transaction_id(i),
l_pri_attribs_hist_rec_tab.pricing_attribute_id(i),
l_pri_attribs_hist_rec_tab.pri_created_by(i),
l_pri_attribs_hist_rec_tab.pri_last_updated_by(i),
l_pri_attribs_hist_rec_tab.pri_last_update_login(i),
l_pri_attribs_hist_rec_tab.pri_object_version_number(i),
l_pri_attribs_hist_rec_tab.pri_security_group_id(i),
l_pri_attribs_hist_rec_tab.old_pricing_context(i),
l_pri_attribs_hist_rec_tab.new_pricing_context(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute1(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute1(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute2(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute2(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute3(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute3(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute4(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute4(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute5(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute5(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute6(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute6(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute7(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute7(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute8(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute8(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute9(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute9(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute10(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute10(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute11(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute11(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute12(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute12(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute13(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute13(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute14(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute14(i),
l_pri_attribs_hist_rec_tab.old_pri_context(i),
l_pri_attribs_hist_rec_tab.new_pri_context(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute1(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute1(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute2(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute2(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute3(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute3(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute4(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute4(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute5(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute5(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute6(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute6(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute7(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute7(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute8(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute8(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute9(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute9(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute10(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute10(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute11(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute11(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute12(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute12(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute13(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute13(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute14(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute14(i),
l_pri_attribs_hist_rec_tab.old_pri_attribute15(i),
l_pri_attribs_hist_rec_tab.new_pri_attribute15(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute15(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute15(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute16(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute16(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute17(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute17(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute18(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute18(i),
l_pri_attribs_hist_rec_tab.pri_full_dump_flag(i),
l_pri_attribs_hist_rec_tab.pri_migrated_flag(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute19(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute19(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute20(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute20(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute21(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute21(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute22(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute22(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute23(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute23(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute24(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute24(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute25(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute25(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute26(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute26(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute27(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute27(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute28(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute28(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute29(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute29(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute30(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute30(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute31(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute31(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute32(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute32(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute33(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute33(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute34(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute34(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute35(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute35(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute36(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute36(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute37(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute37(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute38(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute38(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute39(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute39(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute40(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute40(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute41(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute41(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute42(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute42(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute43(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute43(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute44(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute44(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute45(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute45(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute46(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute46(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute47(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute47(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute48(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute48(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute49(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute49(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute50(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute50(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute51(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute51(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute52(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute52(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute53(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute53(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute54(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute54(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute55(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute55(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute56(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute56(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute57(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute57(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute58(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute58(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute59(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute59(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute60(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute60(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute61(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute61(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute62(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute62(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute63(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute63(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute64(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute64(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute65(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute65(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute66(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute66(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute67(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute67(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute68(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute68(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute69(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute69(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute70(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute70(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute71(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute71(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute72(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute72(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute73(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute73(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute74(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute74(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute75(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute75(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute76(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute76(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute77(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute77(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute78(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute78(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute79(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute79(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute80(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute80(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute81(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute81(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute82(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute82(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute83(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute83(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute84(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute84(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute85(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute85(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute86(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute86(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute87(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute87(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute88(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute88(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute89(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute89(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute90(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute90(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute91(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute91(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute92(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute92(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute93(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute93(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute94(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute94(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute95(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute95(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute96(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute96(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute97(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute97(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute98(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute98(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute99(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute99(i),
l_pri_attribs_hist_rec_tab.old_pricing_attribute100(i),
l_pri_attribs_hist_rec_tab.new_pricing_attribute100(i),
l_pri_attribs_hist_rec_tab.old_pri_active_start_date(i),
l_pri_attribs_hist_rec_tab.new_pri_active_start_date(i),
l_pri_attribs_hist_rec_tab.old_pri_active_end_date(i),
l_pri_attribs_hist_rec_tab.new_pri_active_end_date(i),
l_pri_attribs_hist_rec_tab.pri_creation_date(i),
l_pri_attribs_hist_rec_tab.pri_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_I_PRICING_ATTRIBS_H
Where price_attrib_history_id = l_pri_attribs_hist_rec_tab.price_attrib_history_id(i);
Select csh.*
From CSI_I_ASSETS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_I_ASSETS_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_ins_asset_hist_rec_tab.instance_asset_history_id.DELETE;
l_ins_asset_hist_rec_tab.instance_asset_id.DELETE;
l_ins_asset_hist_rec_tab.transaction_id.DELETE;
l_ins_asset_hist_rec_tab.old_instance_id.DELETE;
l_ins_asset_hist_rec_tab.new_instance_id.DELETE;
l_ins_asset_hist_rec_tab.old_fa_asset_id.DELETE;
l_ins_asset_hist_rec_tab.new_fa_asset_id.DELETE;
l_ins_asset_hist_rec_tab.old_asset_quantity.DELETE;
l_ins_asset_hist_rec_tab.new_asset_quantity.DELETE;
l_ins_asset_hist_rec_tab.old_fa_book_type_code.DELETE;
l_ins_asset_hist_rec_tab.new_fa_book_type_code.DELETE;
l_ins_asset_hist_rec_tab.old_fa_location_id.DELETE;
l_ins_asset_hist_rec_tab.new_fa_location_id.DELETE;
l_ins_asset_hist_rec_tab.old_update_status.DELETE;
l_ins_asset_hist_rec_tab.new_update_status.DELETE;
l_ins_asset_hist_rec_tab.old_ast_active_start_date.DELETE;
l_ins_asset_hist_rec_tab.new_ast_active_start_date.DELETE;
l_ins_asset_hist_rec_tab.old_ast_active_end_date.DELETE;
l_ins_asset_hist_rec_tab.new_ast_active_end_date.DELETE;
l_ins_asset_hist_rec_tab.ast_full_dump_flag.DELETE;
l_ins_asset_hist_rec_tab.ast_created_by.DELETE;
l_ins_asset_hist_rec_tab.ast_creation_date.DELETE;
l_ins_asset_hist_rec_tab.ast_last_updated_by.DELETE;
l_ins_asset_hist_rec_tab.ast_last_update_date.DELETE;
l_ins_asset_hist_rec_tab.ast_last_update_login.DELETE;
l_ins_asset_hist_rec_tab.ast_object_version_number.DELETE;
l_ins_asset_hist_rec_tab.ast_security_group_id.DELETE;
l_ins_asset_hist_rec_tab.ast_migrated_flag.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_ins_asset_hist_rec_tab.old_update_status(l_ctr) := i.old_update_status;
l_ins_asset_hist_rec_tab.new_update_status(l_ctr) := i.new_update_status;
l_ins_asset_hist_rec_tab.ast_last_updated_by(l_ctr) := i.last_updated_by;
l_ins_asset_hist_rec_tab.ast_last_update_date(l_ctr) := i.last_update_date;
l_ins_asset_hist_rec_tab.ast_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_01
,COL_NUM_02
,COL_NUM_03
,COL_NUM_04
,COL_NUM_05
,COL_NUM_06
,COL_NUM_07
,COL_NUM_08
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_03
,COL_CHAR_04
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_ins_asset_hist_rec_tab.instance_asset_history_id(i),
l_ins_asset_hist_rec_tab.transaction_id(i),
l_ins_asset_hist_rec_tab.instance_asset_id(i),
l_ins_asset_hist_rec_tab.old_instance_id(i),
l_ins_asset_hist_rec_tab.new_instance_id(i),
l_ins_asset_hist_rec_tab.old_fa_asset_id(i),
l_ins_asset_hist_rec_tab.new_fa_asset_id(i),
l_ins_asset_hist_rec_tab.old_asset_quantity(i),
l_ins_asset_hist_rec_tab.new_asset_quantity(i),
l_ins_asset_hist_rec_tab.old_fa_location_id(i),
l_ins_asset_hist_rec_tab.new_fa_location_id(i),
l_ins_asset_hist_rec_tab.ast_created_by(i),
l_ins_asset_hist_rec_tab.ast_last_updated_by(i),
l_ins_asset_hist_rec_tab.ast_last_update_login(i),
l_ins_asset_hist_rec_tab.ast_object_version_number(i), -- obj_ver_num
l_ins_asset_hist_rec_tab.ast_security_group_id(i), -- sec_grp_id
l_ins_asset_hist_rec_tab.old_fa_book_type_code(i),
l_ins_asset_hist_rec_tab.new_fa_book_type_code(i),
l_ins_asset_hist_rec_tab.old_update_status(i),
l_ins_asset_hist_rec_tab.new_update_status(i),
l_ins_asset_hist_rec_tab.ast_full_dump_flag(i), --'N', dump_flag
l_ins_asset_hist_rec_tab.ast_migrated_flag(i), -- mig_flag
l_ins_asset_hist_rec_tab.old_ast_active_start_date(i),
l_ins_asset_hist_rec_tab.new_ast_active_start_date(i),
l_ins_asset_hist_rec_tab.old_ast_active_end_date(i),
l_ins_asset_hist_rec_tab.new_ast_active_end_date(i),
l_ins_asset_hist_rec_tab.ast_creation_date(i),
l_ins_asset_hist_rec_tab.ast_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_I_ASSETS_H
Where instance_asset_history_id = l_ins_asset_hist_rec_tab.instance_asset_history_id(i);
Select csh.*
From CSI_I_VERSION_LABELS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_I_VERSION_LABELS_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_ver_label_hist_rec_tab.version_label_history_id.DELETE;
l_ver_label_hist_rec_tab.version_label_id.DELETE;
l_ver_label_hist_rec_tab.transaction_id.DELETE;
l_ver_label_hist_rec_tab.old_version_label.DELETE;
l_ver_label_hist_rec_tab.new_version_label.DELETE;
l_ver_label_hist_rec_tab.old_ver_description.DELETE;
l_ver_label_hist_rec_tab.new_ver_description.DELETE;
l_ver_label_hist_rec_tab.old_date_time_stamp.DELETE;
l_ver_label_hist_rec_tab.new_date_time_stamp.DELETE;
l_ver_label_hist_rec_tab.old_ver_active_start_date.DELETE;
l_ver_label_hist_rec_tab.new_ver_active_start_date.DELETE;
l_ver_label_hist_rec_tab.old_ver_active_end_date.DELETE;
l_ver_label_hist_rec_tab.new_ver_active_end_date.DELETE;
l_ver_label_hist_rec_tab.old_ver_context.DELETE;
l_ver_label_hist_rec_tab.new_ver_context.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute1.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute1.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute2.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute2.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute3.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute3.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute4.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute4.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute5.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute5.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute6.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute6.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute7.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute7.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute8.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute8.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute9.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute9.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute10.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute10.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute11.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute11.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute12.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute12.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute13.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute13.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute14.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute14.DELETE;
l_ver_label_hist_rec_tab.old_ver_attribute15.DELETE;
l_ver_label_hist_rec_tab.new_ver_attribute15.DELETE;
l_ver_label_hist_rec_tab.ver_full_dump_flag.DELETE;
l_ver_label_hist_rec_tab.ver_created_by.DELETE;
l_ver_label_hist_rec_tab.ver_creation_date.DELETE;
l_ver_label_hist_rec_tab.ver_last_updated_by.DELETE;
l_ver_label_hist_rec_tab.ver_last_update_date.DELETE;
l_ver_label_hist_rec_tab.ver_last_update_login.DELETE;
l_ver_label_hist_rec_tab.ver_object_version_number.DELETE;
l_ver_label_hist_rec_tab.ver_security_group_id.DELETE;
l_ver_label_hist_rec_tab.ver_migrated_flag.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_ver_label_hist_rec_tab.ver_last_updated_by(l_ctr) := i.last_updated_by;
l_ver_label_hist_rec_tab.ver_last_update_date(l_ctr) := i.last_update_date;
l_ver_label_hist_rec_tab.ver_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_03
,COL_CHAR_04
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_05
,COL_DATE_06
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_ver_label_hist_rec_tab.version_label_history_id(i),
l_ver_label_hist_rec_tab.transaction_id(i),
l_ver_label_hist_rec_tab.version_label_id(i),
l_ver_label_hist_rec_tab.ver_created_by(i),
l_ver_label_hist_rec_tab.ver_last_updated_by(i),
l_ver_label_hist_rec_tab.ver_last_update_login(i),
l_ver_label_hist_rec_tab.ver_object_version_number(i), -- obj_ver_num
l_ver_label_hist_rec_tab.ver_security_group_id(i), -- sec_grp_id
l_ver_label_hist_rec_tab.old_version_label(i),
l_ver_label_hist_rec_tab.new_version_label(i),
l_ver_label_hist_rec_tab.old_ver_description(i),
l_ver_label_hist_rec_tab.new_ver_description(i),
l_ver_label_hist_rec_tab.old_ver_context(i),
l_ver_label_hist_rec_tab.new_ver_context(i),
l_ver_label_hist_rec_tab.old_ver_attribute1(i),
l_ver_label_hist_rec_tab.new_ver_attribute1(i),
l_ver_label_hist_rec_tab.old_ver_attribute2(i),
l_ver_label_hist_rec_tab.new_ver_attribute2(i),
l_ver_label_hist_rec_tab.old_ver_attribute3(i),
l_ver_label_hist_rec_tab.new_ver_attribute3(i),
l_ver_label_hist_rec_tab.old_ver_attribute4(i),
l_ver_label_hist_rec_tab.new_ver_attribute4(i),
l_ver_label_hist_rec_tab.old_ver_attribute5(i),
l_ver_label_hist_rec_tab.new_ver_attribute5(i),
l_ver_label_hist_rec_tab.old_ver_attribute6(i),
l_ver_label_hist_rec_tab.new_ver_attribute6(i),
l_ver_label_hist_rec_tab.old_ver_attribute7(i),
l_ver_label_hist_rec_tab.new_ver_attribute7(i),
l_ver_label_hist_rec_tab.old_ver_attribute8(i),
l_ver_label_hist_rec_tab.new_ver_attribute8(i),
l_ver_label_hist_rec_tab.old_ver_attribute9(i),
l_ver_label_hist_rec_tab.new_ver_attribute9(i),
l_ver_label_hist_rec_tab.old_ver_attribute10(i),
l_ver_label_hist_rec_tab.new_ver_attribute10(i),
l_ver_label_hist_rec_tab.old_ver_attribute11(i),
l_ver_label_hist_rec_tab.new_ver_attribute11(i),
l_ver_label_hist_rec_tab.old_ver_attribute12(i),
l_ver_label_hist_rec_tab.new_ver_attribute12(i),
l_ver_label_hist_rec_tab.old_ver_attribute13(i),
l_ver_label_hist_rec_tab.new_ver_attribute13(i),
l_ver_label_hist_rec_tab.old_ver_attribute14(i),
l_ver_label_hist_rec_tab.new_ver_attribute14(i),
l_ver_label_hist_rec_tab.old_ver_attribute15(i),
l_ver_label_hist_rec_tab.new_ver_attribute15(i),
l_ver_label_hist_rec_tab.ver_full_dump_flag(i), --'N', dump_flag
l_ver_label_hist_rec_tab.ver_migrated_flag(i), -- mig_flag
l_ver_label_hist_rec_tab.old_ver_active_start_date(i),
l_ver_label_hist_rec_tab.new_ver_active_start_date(i),
l_ver_label_hist_rec_tab.old_ver_active_end_date(i),
l_ver_label_hist_rec_tab.new_ver_active_end_date(i),
l_ver_label_hist_rec_tab.old_date_time_stamp(i),
l_ver_label_hist_rec_tab.new_date_time_stamp(i),
l_ver_label_hist_rec_tab.ver_creation_date(i),
l_ver_label_hist_rec_tab.ver_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_I_VERSION_LABELS_H
Where version_label_history_id = l_ver_label_hist_rec_tab.version_label_history_id(i);
Select csh.*
From CSI_II_RELATIONSHIPS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_II_RELATIONSHIPS_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_rel_hist_rec_tab.relationship_history_id.DELETE;
l_rel_hist_rec_tab.relationship_id.DELETE;
l_rel_hist_rec_tab.transaction_id.DELETE;
l_rel_hist_rec_tab.old_subject_id.DELETE;
l_rel_hist_rec_tab.new_subject_id.DELETE;
l_rel_hist_rec_tab.old_position_reference.DELETE;
l_rel_hist_rec_tab.new_position_reference.DELETE;
l_rel_hist_rec_tab.old_rel_active_start_date.DELETE;
l_rel_hist_rec_tab.new_rel_active_start_date.DELETE;
l_rel_hist_rec_tab.old_rel_active_end_date.DELETE;
l_rel_hist_rec_tab.new_rel_active_end_date.DELETE;
l_rel_hist_rec_tab.old_mandatory_flag.DELETE;
l_rel_hist_rec_tab.new_mandatory_flag.DELETE;
l_rel_hist_rec_tab.old_rel_context.DELETE;
l_rel_hist_rec_tab.new_rel_context.DELETE;
l_rel_hist_rec_tab.old_rel_attribute1.DELETE;
l_rel_hist_rec_tab.new_rel_attribute1.DELETE;
l_rel_hist_rec_tab.old_rel_attribute2.DELETE;
l_rel_hist_rec_tab.new_rel_attribute2.DELETE;
l_rel_hist_rec_tab.old_rel_attribute3.DELETE;
l_rel_hist_rec_tab.new_rel_attribute3.DELETE;
l_rel_hist_rec_tab.old_rel_attribute4.DELETE;
l_rel_hist_rec_tab.new_rel_attribute4.DELETE;
l_rel_hist_rec_tab.old_rel_attribute5.DELETE;
l_rel_hist_rec_tab.new_rel_attribute5.DELETE;
l_rel_hist_rec_tab.old_rel_attribute6.DELETE;
l_rel_hist_rec_tab.new_rel_attribute6.DELETE;
l_rel_hist_rec_tab.old_rel_attribute7.DELETE;
l_rel_hist_rec_tab.new_rel_attribute7.DELETE;
l_rel_hist_rec_tab.old_rel_attribute8.DELETE;
l_rel_hist_rec_tab.new_rel_attribute8.DELETE;
l_rel_hist_rec_tab.old_rel_attribute9.DELETE;
l_rel_hist_rec_tab.new_rel_attribute9.DELETE;
l_rel_hist_rec_tab.old_rel_attribute10.DELETE;
l_rel_hist_rec_tab.new_rel_attribute10.DELETE;
l_rel_hist_rec_tab.old_rel_attribute11.DELETE;
l_rel_hist_rec_tab.new_rel_attribute11.DELETE;
l_rel_hist_rec_tab.old_rel_attribute12.DELETE;
l_rel_hist_rec_tab.new_rel_attribute12.DELETE;
l_rel_hist_rec_tab.old_rel_attribute13.DELETE;
l_rel_hist_rec_tab.new_rel_attribute13.DELETE;
l_rel_hist_rec_tab.old_rel_attribute14.DELETE;
l_rel_hist_rec_tab.new_rel_attribute14.DELETE;
l_rel_hist_rec_tab.old_rel_attribute15.DELETE;
l_rel_hist_rec_tab.new_rel_attribute15.DELETE;
l_rel_hist_rec_tab.rel_full_dump_flag.DELETE;
l_rel_hist_rec_tab.rel_created_by.DELETE;
l_rel_hist_rec_tab.rel_creation_date.DELETE;
l_rel_hist_rec_tab.rel_last_updated_by.DELETE;
l_rel_hist_rec_tab.rel_last_update_date.DELETE;
l_rel_hist_rec_tab.rel_last_update_login.DELETE;
l_rel_hist_rec_tab.rel_object_version_number.DELETE;
l_rel_hist_rec_tab.rel_security_group_id.DELETE;
l_rel_hist_rec_tab.rel_migrated_flag.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_rel_hist_rec_tab.rel_last_updated_by(l_ctr) := i.last_updated_by;
l_rel_hist_rec_tab.rel_last_update_date(l_ctr) := i.last_update_date;
l_rel_hist_rec_tab.rel_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_01
,COL_NUM_02
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_03
,COL_CHAR_04
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_rel_hist_rec_tab.relationship_history_id(i),
l_rel_hist_rec_tab.transaction_id(i),
l_rel_hist_rec_tab.relationship_id(i),
l_rel_hist_rec_tab.old_subject_id(i),
l_rel_hist_rec_tab.new_subject_id(i),
l_rel_hist_rec_tab.rel_created_by(i),
l_rel_hist_rec_tab.rel_last_updated_by(i),
l_rel_hist_rec_tab.rel_last_update_login(i),
l_rel_hist_rec_tab.rel_object_version_number(i), -- obj_ver_num
l_rel_hist_rec_tab.rel_security_group_id(i), -- sec_grp_id
l_rel_hist_rec_tab.old_position_reference(i),
l_rel_hist_rec_tab.new_position_reference(i),
l_rel_hist_rec_tab.old_mandatory_flag(i),
l_rel_hist_rec_tab.new_mandatory_flag(i),
l_rel_hist_rec_tab.old_rel_context(i),
l_rel_hist_rec_tab.new_rel_context(i),
l_rel_hist_rec_tab.old_rel_attribute1(i),
l_rel_hist_rec_tab.new_rel_attribute1(i),
l_rel_hist_rec_tab.old_rel_attribute2(i),
l_rel_hist_rec_tab.new_rel_attribute2(i),
l_rel_hist_rec_tab.old_rel_attribute3(i),
l_rel_hist_rec_tab.new_rel_attribute3(i),
l_rel_hist_rec_tab.old_rel_attribute4(i),
l_rel_hist_rec_tab.new_rel_attribute4(i),
l_rel_hist_rec_tab.old_rel_attribute5(i),
l_rel_hist_rec_tab.new_rel_attribute5(i),
l_rel_hist_rec_tab.old_rel_attribute6(i),
l_rel_hist_rec_tab.new_rel_attribute6(i),
l_rel_hist_rec_tab.old_rel_attribute7(i),
l_rel_hist_rec_tab.new_rel_attribute7(i),
l_rel_hist_rec_tab.old_rel_attribute8(i),
l_rel_hist_rec_tab.new_rel_attribute8(i),
l_rel_hist_rec_tab.old_rel_attribute9(i),
l_rel_hist_rec_tab.new_rel_attribute9(i),
l_rel_hist_rec_tab.old_rel_attribute10(i),
l_rel_hist_rec_tab.new_rel_attribute10(i),
l_rel_hist_rec_tab.old_rel_attribute11(i),
l_rel_hist_rec_tab.new_rel_attribute11(i),
l_rel_hist_rec_tab.old_rel_attribute12(i),
l_rel_hist_rec_tab.new_rel_attribute12(i),
l_rel_hist_rec_tab.old_rel_attribute13(i),
l_rel_hist_rec_tab.new_rel_attribute13(i),
l_rel_hist_rec_tab.old_rel_attribute14(i),
l_rel_hist_rec_tab.new_rel_attribute14(i),
l_rel_hist_rec_tab.old_rel_attribute15(i),
l_rel_hist_rec_tab.new_rel_attribute15(i),
l_rel_hist_rec_tab.rel_full_dump_flag(i), --'N', dump_flag
l_rel_hist_rec_tab.rel_migrated_flag(i), -- mig_flag
l_rel_hist_rec_tab.old_rel_active_start_date(i),
l_rel_hist_rec_tab.new_rel_active_start_date(i),
l_rel_hist_rec_tab.old_rel_active_end_date(i),
l_rel_hist_rec_tab.new_rel_active_end_date(i),
l_rel_hist_rec_tab.rel_creation_date(i),
l_rel_hist_rec_tab.rel_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_II_RELATIONSHIPS_H
Where relationship_history_id = l_rel_hist_rec_tab.relationship_history_id(i);
Select csh.*
From CSI_SYSTEMS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between from_trans and to_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select object_id
Into l_table_id
From csi_object_dictionary
Where object_name = 'CSI_SYSTEMS_H';
Select fnd_profile.value('CSI_TXN_HISTORY_PURGE_BATCH_SIZE')
Into v_batch
From dual;
l_sys_hist_rec_tab.system_history_id.DELETE;
l_sys_hist_rec_tab.system_id.DELETE;
l_sys_hist_rec_tab.transaction_id.DELETE;
l_sys_hist_rec_tab.old_customer_id.DELETE;
l_sys_hist_rec_tab.new_customer_id.DELETE;
l_sys_hist_rec_tab.old_system_type_code.DELETE;
l_sys_hist_rec_tab.new_system_type_code.DELETE;
l_sys_hist_rec_tab.old_system_number.DELETE;
l_sys_hist_rec_tab.new_system_number.DELETE;
l_sys_hist_rec_tab.old_parent_system_id.DELETE;
l_sys_hist_rec_tab.new_parent_system_id.DELETE;
l_sys_hist_rec_tab.old_ship_to_contact_id.DELETE;
l_sys_hist_rec_tab.new_ship_to_contact_id.DELETE;
l_sys_hist_rec_tab.old_bill_to_contact_id.DELETE;
l_sys_hist_rec_tab.new_bill_to_contact_id.DELETE;
l_sys_hist_rec_tab.old_technical_contact_id.DELETE;
l_sys_hist_rec_tab.new_technical_contact_id.DELETE;
l_sys_hist_rec_tab.old_service_admin_contact_id.DELETE;
l_sys_hist_rec_tab.new_service_admin_contact_id.DELETE;
l_sys_hist_rec_tab.old_ship_to_site_use_id.DELETE;
l_sys_hist_rec_tab.new_ship_to_site_use_id.DELETE;
l_sys_hist_rec_tab.old_install_site_use_id.DELETE;
l_sys_hist_rec_tab.new_install_site_use_id.DELETE;
l_sys_hist_rec_tab.old_bill_to_site_use_id.DELETE;
l_sys_hist_rec_tab.new_bill_to_site_use_id.DELETE;
l_sys_hist_rec_tab.old_coterminate_day_month.DELETE;
l_sys_hist_rec_tab.new_coterminate_day_month.DELETE;
l_sys_hist_rec_tab.old_sys_active_start_date.DELETE;
l_sys_hist_rec_tab.new_sys_active_start_date.DELETE;
l_sys_hist_rec_tab.old_sys_active_end_date.DELETE;
l_sys_hist_rec_tab.new_sys_active_end_date.DELETE;
l_sys_hist_rec_tab.old_autocreated_from_system.DELETE;
l_sys_hist_rec_tab.new_autocreated_from_system.DELETE;
l_sys_hist_rec_tab.old_config_system_type.DELETE;
l_sys_hist_rec_tab.new_config_system_type.DELETE;
l_sys_hist_rec_tab.old_name.DELETE;
l_sys_hist_rec_tab.new_name.DELETE;
l_sys_hist_rec_tab.old_sys_description.DELETE;
l_sys_hist_rec_tab.new_sys_description.DELETE;
l_sys_hist_rec_tab.old_sys_context.DELETE;
l_sys_hist_rec_tab.new_sys_context.DELETE;
l_sys_hist_rec_tab.old_sys_attribute1.DELETE;
l_sys_hist_rec_tab.new_sys_attribute1.DELETE;
l_sys_hist_rec_tab.old_sys_attribute2.DELETE;
l_sys_hist_rec_tab.new_sys_attribute2.DELETE;
l_sys_hist_rec_tab.old_sys_attribute3.DELETE;
l_sys_hist_rec_tab.new_sys_attribute3.DELETE;
l_sys_hist_rec_tab.old_sys_attribute4.DELETE;
l_sys_hist_rec_tab.new_sys_attribute4.DELETE;
l_sys_hist_rec_tab.old_sys_attribute5.DELETE;
l_sys_hist_rec_tab.new_sys_attribute5.DELETE;
l_sys_hist_rec_tab.old_sys_attribute6.DELETE;
l_sys_hist_rec_tab.new_sys_attribute6.DELETE;
l_sys_hist_rec_tab.old_sys_attribute7.DELETE;
l_sys_hist_rec_tab.new_sys_attribute7.DELETE;
l_sys_hist_rec_tab.old_sys_attribute8.DELETE;
l_sys_hist_rec_tab.new_sys_attribute8.DELETE;
l_sys_hist_rec_tab.old_sys_attribute9.DELETE;
l_sys_hist_rec_tab.new_sys_attribute9.DELETE;
l_sys_hist_rec_tab.old_sys_attribute10.DELETE;
l_sys_hist_rec_tab.new_sys_attribute10.DELETE;
l_sys_hist_rec_tab.old_sys_attribute11.DELETE;
l_sys_hist_rec_tab.new_sys_attribute11.DELETE;
l_sys_hist_rec_tab.old_sys_attribute12.DELETE;
l_sys_hist_rec_tab.new_sys_attribute12.DELETE;
l_sys_hist_rec_tab.old_sys_attribute13.DELETE;
l_sys_hist_rec_tab.new_sys_attribute13.DELETE;
l_sys_hist_rec_tab.old_sys_attribute14.DELETE;
l_sys_hist_rec_tab.new_sys_attribute14.DELETE;
l_sys_hist_rec_tab.old_sys_attribute15.DELETE;
l_sys_hist_rec_tab.new_sys_attribute15.DELETE;
l_sys_hist_rec_tab.sys_full_dump_flag.DELETE;
l_sys_hist_rec_tab.sys_created_by.DELETE;
l_sys_hist_rec_tab.sys_creation_date.DELETE;
l_sys_hist_rec_tab.sys_last_updated_by.DELETE;
l_sys_hist_rec_tab.sys_last_update_date.DELETE;
l_sys_hist_rec_tab.sys_last_update_login.DELETE;
l_sys_hist_rec_tab.sys_object_version_number.DELETE;
l_sys_hist_rec_tab.sys_security_group_id.DELETE;
l_sys_hist_rec_tab.sys_migrated_flag.DELETE;
l_sys_hist_rec_tab.old_sys_operating_unit_id.DELETE;
l_sys_hist_rec_tab.new_sys_operating_unit_id.DELETE;
Select csi_history_archive_s.Nextval
Into l_archive_id_tbl(l_ctr)
From dual;
l_sys_hist_rec_tab.sys_last_updated_by(l_ctr) := i.last_updated_by;
l_sys_hist_rec_tab.sys_last_update_date(l_ctr) := i.last_update_date;
l_sys_hist_rec_tab.sys_last_update_login(l_ctr) := i.last_update_login;
Insert Into CSI_HISTORY_ARCHIVE
(
HISTORY_ARCHIVE_ID
,OBJECT_ID
,ENTITY_HISTORY_ID
,TRANSACTION_ID
,ENTITY_ID
,COL_NUM_01
,COL_NUM_02
,COL_NUM_03
,COL_NUM_04
,COL_NUM_05
,COL_NUM_06
,COL_NUM_07
,COL_NUM_08
,COL_NUM_09
,COL_NUM_10
,COL_NUM_11
,COL_NUM_12
,COL_NUM_13
,COL_NUM_14
,COL_NUM_15
,COL_NUM_16
,COL_NUM_17
,COL_NUM_18
,COL_NUM_19
,COL_NUM_20
,COL_NUM_21
,COL_NUM_22
,COL_NUM_37
,COL_NUM_38
,COL_NUM_39
,COL_NUM_40
,COL_NUM_41
,COL_CHAR_01
,COL_CHAR_02
,COL_CHAR_03
,COL_CHAR_04
,COL_CHAR_05
,COL_CHAR_06
,COL_CHAR_07
,COL_CHAR_08
,COL_CHAR_09
,COL_CHAR_10
,COL_CHAR_11
,COL_CHAR_12
,COL_CHAR_31
,COL_CHAR_32
,COL_CHAR_33
,COL_CHAR_34
,COL_CHAR_35
,COL_CHAR_36
,COL_CHAR_37
,COL_CHAR_38
,COL_CHAR_39
,COL_CHAR_40
,COL_CHAR_41
,COL_CHAR_42
,COL_CHAR_43
,COL_CHAR_44
,COL_CHAR_45
,COL_CHAR_46
,COL_CHAR_47
,COL_CHAR_48
,COL_CHAR_49
,COL_CHAR_50
,COL_CHAR_51
,COL_CHAR_52
,COL_CHAR_53
,COL_CHAR_54
,COL_CHAR_55
,COL_CHAR_56
,COL_CHAR_57
,COL_CHAR_58
,COL_CHAR_59
,COL_CHAR_60
,COL_CHAR_61
,COL_CHAR_62
,COL_CHAR_71
,COL_CHAR_72
,COL_DATE_01
,COL_DATE_02
,COL_DATE_03
,COL_DATE_04
,COL_DATE_11
,COL_DATE_12
,CONTEXT
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,CREATED_BY
,CREATION_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,OBJECT_VERSION_NUMBER
,SECURITY_GROUP_ID
)
Values
(
l_archive_id_tbl(i),
l_table_id,
l_sys_hist_rec_tab.system_history_id(i),
l_sys_hist_rec_tab.transaction_id(i),
l_sys_hist_rec_tab.system_id(i),
l_sys_hist_rec_tab.old_customer_id(i),
l_sys_hist_rec_tab.new_customer_id(i),
l_sys_hist_rec_tab.old_parent_system_id(i),
l_sys_hist_rec_tab.new_parent_system_id(i),
l_sys_hist_rec_tab.old_bill_to_contact_id(i),
l_sys_hist_rec_tab.new_bill_to_contact_id(i),
l_sys_hist_rec_tab.old_ship_to_contact_id(i),
l_sys_hist_rec_tab.new_ship_to_contact_id(i),
l_sys_hist_rec_tab.old_technical_contact_id(i),
l_sys_hist_rec_tab.new_technical_contact_id(i),
l_sys_hist_rec_tab.old_service_admin_contact_id(i),
l_sys_hist_rec_tab.new_service_admin_contact_id(i),
l_sys_hist_rec_tab.old_ship_to_site_use_id(i),
l_sys_hist_rec_tab.new_ship_to_site_use_id(i),
l_sys_hist_rec_tab.old_install_site_use_id(i),
l_sys_hist_rec_tab.new_install_site_use_id(i),
l_sys_hist_rec_tab.old_bill_to_site_use_id(i),
l_sys_hist_rec_tab.new_bill_to_site_use_id(i),
l_sys_hist_rec_tab.old_autocreated_from_system(i),
l_sys_hist_rec_tab.new_autocreated_from_system(i),
l_sys_hist_rec_tab.old_sys_operating_unit_id(i),
l_sys_hist_rec_tab.new_sys_operating_unit_id(i),
l_sys_hist_rec_tab.sys_created_by(i),
l_sys_hist_rec_tab.sys_last_updated_by(i),
l_sys_hist_rec_tab.sys_last_update_login(i),
l_sys_hist_rec_tab.sys_object_version_number(i), -- obj_ver_num
l_sys_hist_rec_tab.sys_security_group_id(i), -- sec_grp_id
l_sys_hist_rec_tab.old_system_type_code(i),
l_sys_hist_rec_tab.new_system_type_code(i),
l_sys_hist_rec_tab.old_system_number(i),
l_sys_hist_rec_tab.new_system_number(i),
l_sys_hist_rec_tab.old_coterminate_day_month(i),
l_sys_hist_rec_tab.new_coterminate_day_month(i),
l_sys_hist_rec_tab.old_config_system_type(i),
l_sys_hist_rec_tab.new_config_system_type(i),
l_sys_hist_rec_tab.old_name(i),
l_sys_hist_rec_tab.new_name(i),
l_sys_hist_rec_tab.old_sys_description(i),
l_sys_hist_rec_tab.new_sys_description(i),
l_sys_hist_rec_tab.old_sys_context(i),
l_sys_hist_rec_tab.new_sys_context(i),
l_sys_hist_rec_tab.old_sys_attribute1(i),
l_sys_hist_rec_tab.new_sys_attribute1(i),
l_sys_hist_rec_tab.old_sys_attribute2(i),
l_sys_hist_rec_tab.new_sys_attribute2(i),
l_sys_hist_rec_tab.old_sys_attribute3(i),
l_sys_hist_rec_tab.new_sys_attribute3(i),
l_sys_hist_rec_tab.old_sys_attribute4(i),
l_sys_hist_rec_tab.new_sys_attribute4(i),
l_sys_hist_rec_tab.old_sys_attribute5(i),
l_sys_hist_rec_tab.new_sys_attribute5(i),
l_sys_hist_rec_tab.old_sys_attribute6(i),
l_sys_hist_rec_tab.new_sys_attribute6(i),
l_sys_hist_rec_tab.old_sys_attribute7(i),
l_sys_hist_rec_tab.new_sys_attribute7(i),
l_sys_hist_rec_tab.old_sys_attribute8(i),
l_sys_hist_rec_tab.new_sys_attribute8(i),
l_sys_hist_rec_tab.old_sys_attribute9(i),
l_sys_hist_rec_tab.new_sys_attribute9(i),
l_sys_hist_rec_tab.old_sys_attribute10(i),
l_sys_hist_rec_tab.new_sys_attribute10(i),
l_sys_hist_rec_tab.old_sys_attribute11(i),
l_sys_hist_rec_tab.new_sys_attribute11(i),
l_sys_hist_rec_tab.old_sys_attribute12(i),
l_sys_hist_rec_tab.new_sys_attribute12(i),
l_sys_hist_rec_tab.old_sys_attribute13(i),
l_sys_hist_rec_tab.new_sys_attribute13(i),
l_sys_hist_rec_tab.old_sys_attribute14(i),
l_sys_hist_rec_tab.new_sys_attribute14(i),
l_sys_hist_rec_tab.old_sys_attribute15(i),
l_sys_hist_rec_tab.new_sys_attribute15(i),
l_sys_hist_rec_tab.sys_full_dump_flag(i), --'N', dump_flag
l_sys_hist_rec_tab.sys_migrated_flag(i), -- mig_flag
l_sys_hist_rec_tab.old_sys_active_start_date(i),
l_sys_hist_rec_tab.new_sys_active_start_date(i),
l_sys_hist_rec_tab.old_sys_active_end_date(i),
l_sys_hist_rec_tab.new_sys_active_end_date(i),
l_sys_hist_rec_tab.sys_creation_date(i),
l_sys_hist_rec_tab.sys_last_update_date(i),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
l_user_id,
sysdate,
l_user_id,
sysdate,
l_login_id,
1,
null
);
Delete From CSI_SYSTEMS_H
Where system_history_id = l_sys_hist_rec_tab.system_history_id(i);
Select COUNT(*)
Into l_temp
From CSI_ITEM_INSTANCES_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp1
From CSI_I_PARTIES_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp2
From CSI_IP_ACCOUNTS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp3
From CSI_I_ORG_ASSIGNMENTS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp4
From CSI_IEA_VALUES_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp5
From CSI_I_PRICING_ATTRIBS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp6
From CSI_I_ASSETS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp7
From CSI_I_VERSION_LABELS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp8
From CSI_II_RELATIONSHIPS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;
Select COUNT(*)
Into l_temp9
From CSI_SYSTEMS_H csh,
CSI_TRANSACTIONS csit
Where csit.transaction_id between From_trans and To_trans
And csit.creation_date < to_date(purge_to_date, 'YYYY/MM/DD HH24:MI:SS')
And csh.transaction_id = csit.transaction_id;