pallavi
pallavi

Reputation: 117

expression is of wrong type error in oracle

I have created type for subj_code as below:

 TYPE t_c_subj_code IS TABLE OF student.subj_code%TYPE INDEX BY PLS_INTEGER; 

Field i_Subj_Code contains list of subj_code. I want to select subj_code which is not in i_Subj_Code list.
I am trying below procedure:

Procedure GET_Test(i_P_No in varchar2,
                    i_Subj_Code IN t_c_subj_code,
                    o_cursor out t_cursor) is 

BEGIN
    OPEN o_cursor FOR
         Select tt.c_subj_code 
         from student tt
    where 
        tt.i_P_No =i_P_No and
        tt.subj_code NOT IN
            (SELECT COLUMN_VALUE FROM TABLE(i_Subj_Code));
END;

Upvotes: 0

Views: 162

Answers (1)

Magnus
Magnus

Reputation: 98

If you really want to do it in the one SQL statement you could implement a pipelined function which returns the needed part of you collection and use it in the table function.

Upvotes: 1

Related Questions