SSC-EWI-0022

One or more identifiers in a specific statement are considered parameters by default.

The EWI is only generated when Javascript is the target language for Stored Procedures. This is a deprecated translation feature, as Snowflake Scripting is the recommended target language for Stored Procedures.

Some parts in the output code are omitted for clarity reasons.

Severity

Medium

Description

This error is used to report that one or more identifiers in a specific statement are considered parameters by default.

Example Code

Input Code:

IN -> Teradata_01.sql
-- Additional Params: -t javascript
CREATE MACRO SAME_MACRO_COLUMN_AND_PARAMATERS (
LOAD_USER_ID (VARCHAR (32), CHARACTER SET LATIN),
UPDATE_USER_ID (VARCHAR (32), CHARACTER SET LATIN)
) AS (
UPDATE TABLE1 SET LOAD_USER_ID = :LOAD_USER_ID, UPDATE_USER_ID = :UPDATE_USER_ID;
INSERT INTO TABLE1 (LOAD_USER_ID, UPDATE_USER_ID) VALUES (:LOAD_USER_ID, :UPDATE_USER_ID);
DELETE FROM TABLE1 WHERE :LOAD_USER_ID = LOAD_USER_ID;
);

Output Code:

OUT -> Teradata_01.sql
CREATE OR REPLACE PROCEDURE SAME_MACRO_COLUMN_AND_PARAMATERS (LOAD_USER_ID VARCHAR (32), UPDATE_USER_ID VARCHAR (32))
RETURNS STRING
LANGUAGE JAVASCRIPT
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"teradata"}}'
EXECUTE AS CALLER
AS
$$
// SnowConvert Helpers Code section is omitted.

EXEC(`UPDATE TABLE1
   SET
      LOAD_USER_ID = :1,
      UPDATE_USER_ID = :2`,[LOAD_USER_ID,UPDATE_USER_ID]);
// ** SSC-EWI-0022 - ONE OR MORE IDENTIFIERS IN THIS STATEMENT WERE CONSIDERED PARAMETERS BY DEFAULT. REFERENCED TABLE NOT FOUND. **
EXEC(`INSERT INTO TABLE1 (LOAD_USER_ID, UPDATE_USER_ID)
VALUES (:1, :2)`,[LOAD_USER_ID,UPDATE_USER_ID]);
//DELETE FROM
//   TABLE1
//WHERE
//   RTRIM(:LOAD_USER_ID) = RTRIM(LOAD_USER_ID)
!!!RESOLVE EWI!!! /*** SSC-EWI-0073 - PENDING FUNCTIONAL EQUIVALENCE REVIEW FOR 'Delete' NODE ***/!!!
null
$$;

Recommendations

  • Make sure all the dependencies(tables and views) related to the procedure statement are being migrated.

  • If you need more support, you can email us at snowconvert-support@snowflake.com

Last updated