Change Increment index of for loop in stored procedure
posted 7 years ago
HI All ,
To my stored procedure of Oracle i am passing a type , which contains some array of integers.
To fetch the values i am using for loop. The problem is the increment index is 1 . I want to change it to 2. How is it possible ?
Some languages provide a STEP clause, which lets you specify a different increment (5 instead of 1, for example).
PL/SQL has no such structure, but you can easily build one.
Inside the FOR loop, simply multiply each reference to the loop counter by the new increment.
Example 4-17 assigns today's date to elements 5, 10, and 15 of an index-by table.