表达式在oracle中是错误的类型错误

时间:2015-01-26 07:45:39

标签: oracle plsql oracle11g

我已经为subj_code创建了类型,如下所示:

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

字段i_Subj_Code包含subj_code列表。我想选择不在subj_code列表中的i_Subj_Code 我正在尝试以下程序:

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;

1 个答案:

答案 0 :(得分:1)

如果你真的想在一个SQL语句中执行它,你可以实现一个pipelined function,它返回你所需的部分集合并在表函数中使用它。