MSCEWI4035

Declaring a Cursor Variable that it is never initialized is not supported.

Severity

Medium

Description

Currently, a Cursor Variable that is declared but never initialized is not supported by SnowFlake. Thus, the EWI is added, and the code commented out.

Code Example

Input Code:

CREATE OR ALTER PROCEDURE notInitializedCursorTest
AS
BEGIN
    -- Should be marked with MSCEWI4035
    DECLARE @MyCursor CURSOR, @MyCursor2 CURSOR;
    -- Should not be marked
    DECLARE cursorVar CURSOR FORWARD_ONLY STATIC READ_ONLY
        FOR
        SELECT someCol
        FROM someTable;
    RETURN 'DONE';
END;

Output Code:

Recommendations

Last updated