Oracle SYS_REFCURSOR couldn't use as a return type

后端 未结 2 1205
庸人自扰
庸人自扰 2021-01-25 00:29

I need to extract and display all the years for all the records in db using member function in oracle 11g.

CREATE or replace TYPE BODY student_t AS 
MEMBER FUNCT         


        
2条回答
  •  梦毁少年i
    2021-01-25 01:13

    It is much simpler:

    yearDOB SYS_REFCURSOR;
    BEGIN
        OPEN yearDOB for 
        SELECT EXTRACT(YEAR FROM s.dob) c_year 
        from student s;
    
        return yearDOB; 
    END;
    

提交回复
热议问题