From 3daa333f2d834547a7162414bbe3f4f31486f4fb Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Thu, 26 Oct 2023 13:48:01 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Call=5FClickstream=5Fvod=5F=5Fc=E3=81=AE?= =?UTF-8?q?=E6=8C=AF=E5=88=86=E5=88=A4=E6=96=AD=E9=A0=85=E7=9B=AE=E5=9C=B0?= =?UTF-8?q?=E3=81=AE=E6=A1=81=E6=95=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...m_distribution_Call_Clickstream_vod__c.sql | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/rds_mysql/stored_procedure/internal02/crm_distribution_Call_Clickstream_vod__c.sql b/rds_mysql/stored_procedure/internal02/crm_distribution_Call_Clickstream_vod__c.sql index bfd01224..dc95ad79 100644 --- a/rds_mysql/stored_procedure/internal02/crm_distribution_Call_Clickstream_vod__c.sql +++ b/rds_mysql/stored_procedure/internal02/crm_distribution_Call_Clickstream_vod__c.sql @@ -9,7 +9,7 @@ BEGIN -- 振り分けスキーマ DECLARE distribution_schema VARCHAR(20); -- 振り分けカラム -DECLARE target_column_value VARCHAR(64); +DECLARE target_column_value VARCHAR(100); -- 振り分け先テーブルID DECLARE temp_table_id VARCHAR(18); -- カーソルフェッチステータス @@ -20,7 +20,7 @@ DECLARE table_cursor CURSOR FOR SELECT Id, medaca_parent_record_type_id FROM int DECLARE CONTINUE HANDLER FOR NOT FOUND SET fetch_done = TRUE; -- エラー処理 -DECLARE EXIT HANDLER FOR SQLEXCEPTION +DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN GET DIAGNOSTICS CONDITION 1 @error_state = RETURNED_SQLSTATE, @error_msg = MESSAGE_TEXT; @@ -38,28 +38,28 @@ DECLARE EXIT HANDLER FOR SQLEXCEPTION START TRANSACTION; -- UPSERT STATEMENT設定 -SET @upsert_statement_base = - 'INSERT INTO $$distribution_schema$$.crm_Call_Clickstream_vod__c - (Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, MayEdit, - IsLocked, Answer_vod__c, Call_vod__c, Key_Message_vod__c, Mobile_ID_vod__c, Popup_Opened_vod__c, - Possible_Answers_vod__c, Presentation_ID_vod__c, Product_vod__c, Range_Value_vod__c, Rollover_Entered_vod__c, - Selected_Items_vod__c, CLM_ID_vod__c, Question_vod__c, Survey_Type_vod__c, Text_Entered_vod__c, - Toggle_Button_On_vod__c, Track_Element_Description_vod__c, Track_Element_Id_vod__c, Track_Element_Type_vod__c, - Usage_Duration_vod__c, Usage_Start_Time_vod__c, AuxillaryId_vod__c, ParentId_vod__c, Revision_vod__c, +SET @upsert_statement_base = + 'INSERT INTO $$distribution_schema$$.crm_Call_Clickstream_vod__c + (Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, MayEdit, + IsLocked, Answer_vod__c, Call_vod__c, Key_Message_vod__c, Mobile_ID_vod__c, Popup_Opened_vod__c, + Possible_Answers_vod__c, Presentation_ID_vod__c, Product_vod__c, Range_Value_vod__c, Rollover_Entered_vod__c, + Selected_Items_vod__c, CLM_ID_vod__c, Question_vod__c, Survey_Type_vod__c, Text_Entered_vod__c, + Toggle_Button_On_vod__c, Track_Element_Description_vod__c, Track_Element_Id_vod__c, Track_Element_Type_vod__c, + Usage_Duration_vod__c, Usage_Start_Time_vod__c, AuxillaryId_vod__c, ParentId_vod__c, Revision_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, Answer_vod__c, Call_vod__c, Key_Message_vod__c, Mobile_ID_vod__c, Popup_Opened_vod__c, - Possible_Answers_vod__c, Presentation_ID_vod__c, Product_vod__c, Range_Value_vod__c, Rollover_Entered_vod__c, - Selected_Items_vod__c, CLM_ID_vod__c, Question_vod__c, Survey_Type_vod__c, Text_Entered_vod__c, - Toggle_Button_On_vod__c, Track_Element_Description_vod__c, Track_Element_Id_vod__c, Track_Element_Type_vod__c, - Usage_Duration_vod__c, Usage_Start_Time_vod__c, AuxillaryId_vod__c, ParentId_vod__c, Revision_vod__c, + SELECT + Id, IsDeleted, Name, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, MayEdit, + IsLocked, Answer_vod__c, Call_vod__c, Key_Message_vod__c, Mobile_ID_vod__c, Popup_Opened_vod__c, + Possible_Answers_vod__c, Presentation_ID_vod__c, Product_vod__c, Range_Value_vod__c, Rollover_Entered_vod__c, + Selected_Items_vod__c, CLM_ID_vod__c, Question_vod__c, Survey_Type_vod__c, Text_Entered_vod__c, + Toggle_Button_On_vod__c, Track_Element_Description_vod__c, Track_Element_Id_vod__c, Track_Element_Type_vod__c, + Usage_Duration_vod__c, Usage_Start_Time_vod__c, AuxillaryId_vod__c, ParentId_vod__c, Revision_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_Call_Clickstream_vod__c AS internaltb - WHERE + FROM + internal02.crm_Call_Clickstream_vod__c AS internaltb + WHERE internaltb.Id = ? - ON DUPLICATE KEY UPDATE + ON DUPLICATE KEY UPDATE Id = internaltb.Id, IsDeleted = internaltb.IsDeleted, Name = internaltb.Name, CreatedDate = internaltb.CreatedDate, CreatedById = internaltb.CreatedById, LastModifiedDate = internaltb.LastModifiedDate, LastModifiedById = internaltb.LastModifiedById, @@ -94,7 +94,7 @@ TableCursorLoop: LOOP SET @distribution_schema = internal02.get_distribution_to_schema('crm_Call_Clickstream_vod__c', 'medaca_parent_record_type_id', target_column_value); SET @temp_table_id = temp_table_id; - + SET @upsert_statement = REPLACE(@upsert_statement_base, "$$distribution_schema$$", @distribution_schema); -- UPSERT実行