This warning is used to indicate that the statement has usages of cursor for loop. A cursor for loop is a control structure that allows to iterate over the result set one row at a time.
This scenario could be considered a complex pattern when the code inside the loop is overly complex. E.g. if the SELECT statement inside the cursor for loop returns a large result set, or if the code inside the loop involves complex operations or nested loops, the cursor for loop could become slow and inefficient. This warning is meant to be a helper to spot some problems that a static-code analyzer such as SnowConvert cannot.
CREATEORREPLACEPROCEDURE teradata_cursor_for_loop ()RETURNSVARCHARLANGUAGESQLCOMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"teradata"}}'
EXECUTEASCALLERAS$$BEGIN LET cUsgClass CURSORFORSELECT col1FROM sample_table;--** SSC-PRF-0004 - THIS STATEMENT HAS USAGES OF CURSOR FOR LOOP **FOR fUsgClass IN cUsgClass DO var1 := :temp_fUsgClass_col1;ENDFOR;END;$$;
Oracle
IN -> Oracle_01.sql
CREATEORREPLACEPROCEDURE oracle_cursor_for_loop ASBEGINFOR r1 IN (SELECT col1 FROM sample_table) LOOPNULL;ENDLOOP;END;
OUT -> Oracle_01.sql
CREATEORREPLACEPROCEDURE oracle_cursor_for_loop ()RETURNSVARCHARLANGUAGESQLCOMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
EXECUTEASCALLERAS$$BEGIN LET temporary_for_cursor_0 CURSORFOR (SELECT col1 FROM sample_table );--** SSC-PRF-0004 - THIS STATEMENT HAS USAGES OF CURSOR FOR LOOP **FOR r1 IN temporary_for_cursor_0 DONULL;ENDFOR;END;$$;