EXIT or QUIT

Translation reference for the conversion of EXIT or QUIT command to Snowflake Scripting

Logs off all database sessions and then exits BTEQ.

The highest severity value encountered during BTEQ's execution will by default be used as BTEQ's return code value unless an argument is explicitly supplied. (Teradata Basic Query Reference EXIT or QUIT Command)

.<ExitCommand> [<Result>];
<ExitCommand> := EXIT | QUIT
<Result> := <Status_variable> | Number 
<Status_variable> := ACTIVITY_COUNT | ERRORCODE | ERRORLEVEL

Sample Source Patterns

Basic IF example

IN -> Teradata_01.bteq
-- Additional Params: -q SnowScript
.QUIT ERRORCODE;
OUT -> Teradata_01.sql
EXECUTE IMMEDIATE
$$
  DECLARE
    STATUS_OBJECT OBJECT := OBJECT_CONSTRUCT('SQLCODE', 0);
  BEGIN
    RETURN STATUS_OBJECT['SQLCODE'] /*** SSC-FDM-TD0013 - THE SNOWFLAKE ERROR CODE MISMATCH THE ORIGINAL TERADATA ERROR CODE ***/;
  END
$$

Known Issues

When the EXIT or QUIT command doesn't have an input, it returns the ERRORLEVEL as default. However, SnowConvert transforms it to return 0.

  1. SSC-FDM-TD0013: The Snowflake error code mismatch the original Teradata error code.

Last updated