Workaround for cursors using parameters or procedure variables
Description
This section describes how to simulate the usage of cursor parameters and procedure variables inside the query of a cursor. The name of the variables or parameters is replaced with bindings using the ?
sign. Then, when the cursor is opened, the values should be passed with the USING
clause.
Cursor with local variables
Use bindings for the query in the cursor for variable or procedure parameter used and open the cursor with the USING
clause.
IN -> Oracle_01.sql
OUT -> Oracle_01.sql
Cursor with parameters
Use bindings for the query in the cursor for each parameter used and open the cursor with the USING
clause. Keep in mind that a parameter that is used multiple times on a single cursor may require passing the variable multiple times in the USING
clause.
IN -> Oracle_02.sql
OUT -> Oracle_02.sql
Related EWIs
SSC-PRF-0004: This statement has usages of cursor for loop
Last updated