MSCEWI2075

The Snowflake error code mismatch the original Teradata error code

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

Low

Description

This message is shown because the error code saved in the BTEQ ERRORCODE build-in variable could not be the same in Snowflake Scripting.

Example code

Input code:

SELECT * FROM table1;
 
.IF ERRORCODE<>0 THEN .EXIT 1

.QUIT 0

Output code:

EXECUTE IMMEDIATE
$$
  DECLARE
    STATUS_OBJECT OBJECT;
  BEGIN
    BEGIN
      SELECT
        *
      FROM
        PUBLIC.table1;
      STATUS_OBJECT := OBJECT_CONSTRUCT('SQLROWCOUNT', SQLROWCOUNT);
    EXCEPTION
      WHEN OTHER THEN
        STATUS_OBJECT := OBJECT_CONSTRUCT('SQLCODE', SQLCODE, 'SQLERRM', SQLERRM, 'SQLSTATE', SQLSTATE);
    END;
    IF (STATUS_OBJECT['SQLCODE'] /*** MSC-WARNING - MSCEWI2075 - THE SNOWFLAKE ERROR CODE MISMATCH THE ORIGINAL TERADATA ERROR CODE ***/ != 0) THEN
      RETURN 1;
    END IF;
    RETURN 0;
  END
$$

Recommendations

Last updated