I am working on ORACLE STORED PROCEDURES and I have a doubt. I have a query which fetches more than 1 row and I want to store all those 3 row\'s values in 1 Variable. Can anybod
You'll need a cursor for that:
DECLARE
CURSOR stud_cur IS
SELECT STUDENT_NAME FROM STUDENT.STUDENT_DETAILS WHERE CLASS_ID= 'C';
l_stud STUDENT.STUDENT_DETAILS%ROWTYPE;
BEGIN
OPEN stud_cur;
LOOP
FETCH stud_cur INTO l_stud;
EXIT WHEN stud_cur%NOTFOUND;
/* The first time, stud_cur.STUDENT_NAME will be Jack, then Jill... */
END LOOP;
CLOSE stud_cur;
END;