SSC-EWI-OR0110

For Update Clause is not supported in Snowflake

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.

Some parts in the output code are omitted for clarity reasons.

Severity

High

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:

IN -> Oracle_01.sql
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

  • Handle the column update in the UPDATE/DELETE query for more details check SSC-EWI-0075.

  • If you need more support, you can email us at [email protected]

Last updated