GOTO

Translation reference for the conversion of Goto command to Snowflake Scripting

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Description

The BTEQ Goto command skips over all intervening BTEQ commands and SQL statements until a specified label is encountered, then resumes processing as usual. (Teradata Basic Query Reference Goto Command)

.GOTO LabelName;

Sample Source Patterns

Basic GOTO example

Snowflake scripting doesn't have an equivalent statement for Teradata BTEQ Goto command, but fortunately it can be removed from the input code and get an equivalent code, due to the sequence of Goto and Labels commands in reverse topological order always. In other words, the definitions come after their uses. Thus, Snowconvert just needs to copy bottom-up all Label section code to its corresponding Goto statements.

IN -> Teradata_01.bteq
-- Additional Params: -q SnowScript
.LOGON 0/dbc,dbc;
   DATABASE tduser;
.LOGON 127.0.0.1/dbc,dbc;

INSERT INTO TABLEB VALUES (1);
.IF activitycount = 0 then .GOTO SECTIONA
.IF activitycount >= 1 then .GOTO SECTIONB

.label SECTIONA
.REMARK 'Zero Hours on Account'
.GOTO SECTIONC

.label SECTIONB
.REMARK 'Total Hours on Account'

.label SECTIONC
.logoff      
.exit

Known Issues

No issues were found.

  1. SSC-EWI-0001: Unrecognized token on the line of the source code.

  2. SSC-FDM-0027: Removed next statement, not applicable in SnowFlake.

  3. SSC-EWI-0073: Pending Functional Equivalence Review

  4. SSC-FDM-TD0026: GOTO statement was removed due to if statement inversion.

Last updated