How can you refer to a cursor’s specific value if there are multiple values returned?
DECLARE
X INTEGER;
CURSOR c1 IS SELECT col1, col2, col3.....;
BEGIN
OPEN c1;
LOOP
EXIT WHEN c1%NOTFOUND;
FETCH (col2 from c1) INTO X;
END LOOP;
END;
Why would you want to? Presumably, if you are selecting three columns in your cursor declaration, you need all three columns in your code, so you would need to fetch all three columns into three separate local variables, i.e.
Alternately, you can declare a record type based on the cursor declaration and fetch into that
You can also get rid of the explicit loop entirely which is generally the preferred approach since you don’t have to worry about cursor leaks and (in modern versions) Oracle can automatically do bulk collects for you