Merge pull request #300 feature-NEWDWH2021-1288-crm_distribution_Product_Metrics_vod__c_fix into develop-4-crm-medical

This commit is contained in:
nik afiq 2023-10-24 10:50:22 +09:00
commit a5e58ebc7e

View File

@ -1,3 +1,7 @@
-- A5M2で実行時に[SQL] - [スラッシュ(/)のみの行でSQLを区切る]に変えてから実行する
-- $$から始まる文字は後からREPLACEする文字を示す独自ルール
-- 当ストアドプロシージャは、同一セッション内での並列処理を実行することができない
-- 実行者の権限でストアドプロシージャを実行するために、「SQL SECURITY INVOKER」を付与している
CREATE PROCEDURE `internal02`.`crm_distribution_Product_Metrics_vod__c`()
SQL SECURITY INVOKER
BEGIN
@ -63,7 +67,7 @@ SET @upsert_statement_base =
FROM
internal02.crm_Product_Metrics_vod__c AS internaltb
WHERE
Id = ?
internaltb.Id = ?
ON DUPLICATE KEY UPDATE
IsDeleted = internaltb.IsDeleted, Name = internaltb.Name, CreatedDate = internaltb.CreatedDate,
CreatedById = internaltb.CreatedById, LastModifiedDate = internaltb.LastModifiedDate,
@ -112,7 +116,7 @@ TableCursorLoop: LOOP
LEAVE TableCursorLoop;
END IF;
SET @distribution_schema = get_distribution_to_schema('crm_Product_Metrics_vod__c', 'medaca_parent_msj_product_classification__c', target_column_value);
SET @distribution_schema = internal02.get_distribution_to_schema('crm_Product_Metrics_vod__c', 'medaca_parent_msj_product_classification__c', target_column_value);
SET @temp_table_id = temp_table_id;
SET @upsert_statement = REPLACE(@upsert_statement_base, "$$distribution_schema$$", @distribution_schema);