MSCEWI3110

For Update Clause is not supported in Snowflake

triangle-exclamation

Severity

Low

Description

There is no equivalent for FOR UPDATE clause in Snow Scripting so an EWI is added and the clause is commented out

Example Code

Input Code:

CREATE OR REPLACE PROCEDURE for_update_clause
AS
    update_record f_employee%rowtype;
    CURSOR c1 IS SELECT * FROM f_employee FOR UPDATE OF employee_number nowait;
BEGIN
    FOR CREC IN C1 LOOP
	UPDATE f_employee SET employee_number = employee_number + 1000 WHERE CURRENT OF c1;
	IF crec.id = 2 THEN
	    DELETE FROM f_employee WHERE CURRENT OF c1;
	    EXIT;
	END IF;
    END LOOP;
END;

Output Code:

Recommendations

Last updated