Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

We have a snowflake procedure that insert record into a table, something similar to below procedure. When this procedure is called by multiple application in multiple session, it is behaving erratic and throwing error. I understand when multiple session is trying to write to same table it is throwing error. Is there any work around to handle this scenario, since we do want to duplicate this proc for every application. Thanks in advance.

CREATE OR REPLACE PROCEDURE "SP_CRT_METADATA"(SOURCE_TYPE VARCHAR, BATCH_ID FLOAT)
RETURNS VARCHAR(16777216)
LANGUAGE JAVASCRIPT
EXECUTE AS OWNER
AS '

hist_col_load =` INSERT INTO SHRD_COL_MSTR_HIST SELECT * FROM SHRD_COL_MSTR WHERE SRC_TYPE =''`+SOURCE_TYPE+`''  AND ACTIVE_IND =''Y''`;

snowflake.execute({sqlText: hist_col_load});

'
question from:https://stackoverflow.com/questions/65944472/multiple-session-executing-snowflake-procedure-insert-into-same-table

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
223 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...