Links

MSCEWI2070

The next statement was removed because it was inaccessible

Severity

Low

Description

After the GOTO statements are replaced with the LABEL sections, sometimes there are statements that are inaccessible because a return statement is defined before. Therefore, these declarations are not necessary, so they end up being commented.

Example Code

Input Code:

.LOGON dbc,dbc;
select 1;
.GOTO LABEL_B
.label LABEL_B
.logoff
.exit

Output Code

EXECUTE IMMEDIATE
$$
BEGIN
/*** MSC-ERROR - MSCEWI1037 - TRANSLATION FOR SCRIPT STATEMENTS IS PLANNED TO BE DELIVERED IN THE FUTURE ***/
/*.LOGON dbc,dbc;*/
SELECT
1;
/*** MSC-WARNING - MSCEWI2071 - GOTO LABEL_B WAS REPLACED WITH THE LABEL SECTION WITH THE SAME NAME ***/
/*** MSC-WARNING - MSCEWI1002 - REMOVED NEXT STATEMENT, NOT APPLICABLE IN SNOWFLAKE. ***/
/*.label LABEL_B*/
/*** MSC-ERROR - MSCEWI1037 - TRANSLATION FOR SCRIPT STATEMENTS IS PLANNED TO BE DELIVERED IN THE FUTURE ***/
/*.logoff*/
RETURN 0;
/*** MSC-WARNING - MSCEWI1002 - REMOVED NEXT STATEMENT, NOT APPLICABLE IN SNOWFLAKE. ***/
/*.label LABEL_B*/
/*** MSC-ERROR - MSCEWI1037 - TRANSLATION FOR SCRIPT STATEMENTS IS PLANNED TO BE DELIVERED IN THE FUTURE ***/
/*.logoff*/
/*** MSC-WARNING - MSCEWI2070 - REMOVED NEXT STATEMENT, IT WAS INACCESSIBLE. ***/
/*RETURN 0;*/
END
$$

Recommendations