is STEP function in oracle?
Did you read or test in Oracle?
TO my knowledge, there is no built-in function named "Step" in Oracle. I would lprefer you to download the Orcle documentation from Oracle site or buy a fundemental Oracle book.
my requirement is the FOR LOOP should increment by 5 values.
(eg) FOR i IN 1..100 LOOP
now i use MOD function to get the 5th row
i want a simple function
First, I would do as everyone suggested and figure out how to get to the documentation.
The easiest way is to simply make a free account on Oracle Technology Network. This would then allow you to get to this link:
There, you would find the following:
Unfortunately, there is no STEP function in PL/SQL - spiffy, eh?
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. In the following example, you assign today's date to elements 5, 10, and 15 of an index-by table:
TYPE DateList IS TABLE OF DATE INDEX BY BINARY_INTEGER;
k CONSTANT INTEGER := 5; -- set new increment
FOR j IN 1..3 LOOP
dates(j*k) := SYSDATE; -- multiply loop counter by increment
Click Here to Expand Forum to Full Width