振分判断項目UPSERTに追加

This commit is contained in:
Nik Afiq 2023-10-27 11:39:23 +09:00
parent 64c4352c45
commit cb404b2baf

View File

@ -40,21 +40,21 @@ START TRANSACTION;
-- UPSERT STATEMENT設定
SET @upsert_statement_base =
'INSERT INTO $$distribution_schema$$.crm_Call2_Key_Message_vod__c
(Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp,
MayEdit, IsLocked, Account_vod__c, Call2_vod__c, Reaction_vod__c, Product_vod__c, Key_Message_vod__c,
Mobile_ID_vod__c, Contact_vod__c, Call_Date_vod__c, User_vod__c, Category_vod__c, Vehicle_vod__c,
Is_Parent_Call_vod__c, Override_Lock_vod__c, CLM_ID_vod__c, Slide_Version_vod__c, Duration_vod__c,
Presentation_ID_vod__c, Start_Time_vod__c, Attendee_Type_vod__c, Entity_Reference_Id_vod__c, Segment_vod__c,
Display_Order_vod__c, Clm_Presentation_Name_vod__c, Clm_Presentation_Version_vod__c, Clm_Presentation_vod__c,
file_name, file_row_cnt, delete_flg, ins_user, ins_date, upd_user, upd_date)
(Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp,
MayEdit, IsLocked, Account_vod__c, Call2_vod__c, Reaction_vod__c, Product_vod__c, Key_Message_vod__c,
Mobile_ID_vod__c, Contact_vod__c, Call_Date_vod__c, User_vod__c, Category_vod__c, Vehicle_vod__c,
Is_Parent_Call_vod__c, Override_Lock_vod__c, CLM_ID_vod__c, Slide_Version_vod__c, Duration_vod__c,
Presentation_ID_vod__c, Start_Time_vod__c, Attendee_Type_vod__c, Entity_Reference_Id_vod__c, Segment_vod__c,
Display_Order_vod__c, Clm_Presentation_Name_vod__c, Clm_Presentation_Version_vod__c, Clm_Presentation_vod__c,
medaca_parent_record_type_id, file_name, file_row_cnt, delete_flg, ins_user, ins_date, upd_user, upd_date)
SELECT
Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp,
MayEdit, IsLocked, Account_vod__c, Call2_vod__c, Reaction_vod__c, Product_vod__c, Key_Message_vod__c,
Mobile_ID_vod__c, Contact_vod__c, Call_Date_vod__c, User_vod__c, Category_vod__c, Vehicle_vod__c,
Is_Parent_Call_vod__c, Override_Lock_vod__c, CLM_ID_vod__c, Slide_Version_vod__c, Duration_vod__c,
Presentation_ID_vod__c, Start_Time_vod__c, Attendee_Type_vod__c, Entity_Reference_Id_vod__c, Segment_vod__c,
Display_Order_vod__c, Clm_Presentation_Name_vod__c, Clm_Presentation_Version_vod__c, Clm_Presentation_vod__c,
file_name, file_row_cnt, delete_flg, ins_user, ins_date, upd_user, upd_date
Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp,
MayEdit, IsLocked, Account_vod__c, Call2_vod__c, Reaction_vod__c, Product_vod__c, Key_Message_vod__c,
Mobile_ID_vod__c, Contact_vod__c, Call_Date_vod__c, User_vod__c, Category_vod__c, Vehicle_vod__c,
Is_Parent_Call_vod__c, Override_Lock_vod__c, CLM_ID_vod__c, Slide_Version_vod__c, Duration_vod__c,
Presentation_ID_vod__c, Start_Time_vod__c, Attendee_Type_vod__c, Entity_Reference_Id_vod__c, Segment_vod__c,
Display_Order_vod__c, Clm_Presentation_Name_vod__c, Clm_Presentation_Version_vod__c, Clm_Presentation_vod__c,
medaca_parent_record_type_id, file_name, file_row_cnt, delete_flg, ins_user, ins_date, upd_user, upd_date
FROM
internal02.crm_Call2_Key_Message_vod__c AS internaltb
WHERE
@ -77,7 +77,8 @@ SET @upsert_statement_base =
Display_Order_vod__c = internaltb.Display_Order_vod__c, Clm_Presentation_Name_vod__c = internaltb.Clm_Presentation_Name_vod__c,
Clm_Presentation_Version_vod__c = internaltb.Clm_Presentation_Version_vod__c,
Clm_Presentation_vod__c = internaltb.Clm_Presentation_vod__c, file_name = internaltb.file_name,
file_row_cnt = internaltb.file_row_cnt, upd_user = CURRENT_USER(), upd_date = CURRENT_TIMESTAMP();';
file_row_cnt = internaltb.file_row_cnt, upd_user = CURRENT_USER(), upd_date = CURRENT_TIMESTAMP(),
medaca_parent_record_type_id = internaltb.medaca_parent_record_type_id;';
OPEN table_cursor;