Assginement-21 (User Defined Function and Index by Table)
Assginement-21 (User Defined Function and Index by Table)
Assginement-21 (User Defined Function and Index by Table)
Index by table
DECLARE
TYPE t_hire_date IS TABLE OF STUDENTS_DETAIL.STU_GRADE%TYPE
INDEX BY VARCHAR(20);
v_hire_date_tab t_hire_date;
v_hire_date_count VARCHAR(20);
BEGIN
FOR stu_rec IN (SELECT STU_GRADE FROM STUDENTS_DETAIL)
LOOP
v_hire_date_tab(stu_rec.STU_GRADE):=stu_rec.STU_GRADE;
END LOOP;
DBMS_OUTPUT.PUT_LINE(v_hire_date_tab.COUNT);
END;