英文:
SNowflake - Syntax error: unexpected '<EOF>'. Query size limit?
问题
您遇到的问题可能与过程中的字符数限制有关。尝试通过删除注释来增加列数可能有效,因为注释会增加字符数。您可以尝试优化您的代码以减少字符数,或者查看您使用的数据库管理系统是否有字符数限制的文档,以了解更多关于限制的信息。
不过,请注意,对于复杂的存储过程,过多的列可能会使代码难以维护和理解。在添加大量列之前,最好考虑是否可以重新设计数据库模式,以更好地满足您的需求。
如果您需要进一步的帮助或解决方案,请提供更多信息,我将尽力提供支持。
英文:
I have a procedure and I want to modify this. When I use this request:
CREATE OR REPLACE PROCEDURE import_stage_sfr_ac_reeng_fixe_handicall_bordeaux(p_loading_mode VARCHAR)
RETURNS VARCHAR NOT NULL
LANGUAGE SQL
AS
BEGIN
IF (:p_loading_mode ='incremental') THEN
COPY INTO SFR_AC_REENG_FIXE_HANDICALL_BORDEAUX (
V_NUM_COMMANDE_MIG,
V_SITE_CMD,
V_ACTIVITE_EZY,
V_TYPE_AC,
D_JOUR_CMD,
D_JOUR_PANIER,
V_SEMAINE_CMD,
V_MOIS_CMD,
V_LOGIN_CC_CMD,
V_NUM_CONTRAT,
V_TYPE_ACTE,
B_MIG,
V_COURANT_PTA_MIG,
V_LIBL_COURANT_PTA_MIG,
V_FUTUR_PTA_MIG,
V_LIBL_FUTUR_PTA_MIG,
V_LIBL_FUTUR_PTA_MIG_COURT,
B_REMISE,
V_LIBL_REMISE,
N_MT_REMISE_M_TTC,
B_USAGE,
V_LIBL_USAGE,
V_NOM,
V_PRENOM,
N_FACIAL_AVANT,
N_FACIAL_APRES,
N_REMISE_AVANT,
N_REMISE_APRES,
N_MOUVEMENT_VALEUR,
V_CODE_CAMPAGNE,
B_FLAG_HBD,
V_CODE_CAMPAGNE,
V_CODE_LOT,
V_RAC,
V_TECH_NOM_FICHIER,
V_TECH_STATUT_TRAITEMENT,
V_TECH_NOM_TRAITEMENT,
TS_TECH_DEBUT_TRAITEMENT
) FROM (
SELECT
$12,
$1,
$2,
$3,
TO_DATE($4, 'YYYY-MM-DD'),
TO_DATE($5, 'YYYY-MM-DD'),
$6,
$7,
$8,
$9,
$10,
CAST($11 AS BOOLEAN),
$13,
$14,
$15,
$16,
$17,
CAST($18 AS BOOLEAN),
$19,
CAST($20 AS NUMBER(10, 0)),
CAST($21 AS BOOLEAN),
$22,
$23,
$24,
CAST(REPLACE($25, ',', '.') AS NUMBER(6, 3)),
CAST(REPLACE($26, ',', '.') AS NUMBER(6, 3)),
CAST(REPLACE($27, ',', '.') AS NUMBER(4, 2)),
CAST(REPLACE($28, ',', '.') AS NUMBER(4, 2)),
CAST(REPLACE($29, ',', '.') AS NUMBER(6, 3)),
$30,
TO_BOOLEAN($31),
$32,
$33,
$34,
METADATA$FILENAME,
'I',
'INGEST MODE : '|| :p_loading_mode,
current_timestamp(0)
FROM @ES_SFR )
FILE_FORMAT = ( FORMAT_NAME = FF_INGEST_CSV_SFR)
PATTERN = '.*incremental.*ac_reeng_fixe_handicall_bordeaux.*\.csv';
END IF;
It work. But if I add just a column, I have the message Syntax error: unexpected '<EOF>'.
no matter the column.
Example:
CREATE OR REPLACE PROCEDURE import_stage_sfr_ac_reeng_fixe_handicall_bordeaux(p_loading_mode VARCHAR)
RETURNS VARCHAR NOT NULL
LANGUAGE SQL
AS
BEGIN
IF (:p_loading_mode ='incremental') THEN
COPY INTO SFR_AC_REENG_FIXE_HANDICALL_BORDEAUX (
V_NUM_COMMANDE_MIG,
V_SITE_CMD,
V_ACTIVITE_EZY,
V_TYPE_AC,
D_JOUR_CMD,
D_JOUR_PANIER,
V_SEMAINE_CMD,
V_MOIS_CMD,
V_LOGIN_CC_CMD,
V_NUM_CONTRAT,
V_TYPE_ACTE,
B_MIG,
V_COURANT_PTA_MIG,
V_LIBL_COURANT_PTA_MIG,
V_FUTUR_PTA_MIG,
V_LIBL_FUTUR_PTA_MIG,
V_LIBL_FUTUR_PTA_MIG_COURT,
B_REMISE,
V_LIBL_REMISE,
N_MT_REMISE_M_TTC,
B_USAGE,
V_LIBL_USAGE,
V_NOM,
V_PRENOM,
N_FACIAL_AVANT,
N_FACIAL_APRES,
N_REMISE_AVANT,
N_REMISE_APRES,
N_MOUVEMENT_VALEUR,
V_CODE_CAMPAGNE,
B_FLAG_HBD,
V_CODE_CAMPAGNE,
V_CODE_LOT,
V_RAC,
V_PROMO_TR,
V_TECH_NOM_FICHIER,
V_TECH_STATUT_TRAITEMENT,
V_TECH_NOM_TRAITEMENT,
TS_TECH_DEBUT_TRAITEMENT
) FROM (
SELECT
$12,
$1,
$2,
$3,
TO_DATE($4, 'YYYY-MM-DD'),
TO_DATE($5, 'YYYY-MM-DD'),
$6,
$7,
$8,
$9,
$10,
CAST($11 AS BOOLEAN),
$13,
$14,
$15,
$16,
$17,
CAST($18 AS BOOLEAN),
$19,
CAST($20 AS NUMBER(10, 0)),
CAST($21 AS BOOLEAN),
$22,
$23,
$24,
CAST(REPLACE($25, ',', '.') AS NUMBER(6, 3)),
CAST(REPLACE($26, ',', '.') AS NUMBER(6, 3)),
CAST(REPLACE($27, ',', '.') AS NUMBER(4, 2)),
CAST(REPLACE($28, ',', '.') AS NUMBER(4, 2)),
CAST(REPLACE($29, ',', '.') AS NUMBER(6, 3)),
$30,
TO_BOOLEAN($31),
$32,
$33,
$34,
$35,
METADATA$FILENAME,
'I',
'INGEST MODE : '|| :p_loading_mode,
current_timestamp(0)
FROM @ES_SFR )
FILE_FORMAT = ( FORMAT_NAME = FF_INGEST_CSV_SFR)
PATTERN = '.*incremental.*ac_reeng_fixe_handicall_bordeaux.*\.csv';
END IF;
I search since this morning, I was able to add more column by deleting the comments. I therefore really wonder if this is not a limitation of the number of characters in the procedure. Any idea ?
Thanks
答案1
得分: 1
要解决问题,您需要在代码块周围添加$$
符号进行引用。
示例:
CREATE OR REPLACE PROCEDURE import_stage_sfr_ac_reeng_fixe_handicall_bordeaux(p_loading_mode VARCHAR)
RETURNS VARCHAR NOT NULL
LANGUAGE SQL
AS
$$
BEGIN
--您的代码脚本块
END
$$;
英文:
To fix the issue you need to add the $$
sings to quote the code block.
Example:
CREATE OR REPLACE PROCEDURE import_stage_sfr_ac_reeng_fixe_handicall_bordeaux(p_loading_mode VARCHAR)
RETURNS VARCHAR NOT NULL
LANGUAGE SQL
AS
$$
BEGIN
--your code the scripting block
END
$$;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论