在下面的过程中,我需要使用 refcursor 返回一个布尔值
CREATE OR REPLACE PROCEDURE gmmt_proc.co_col_preference_details_sp (
p_applcd IN VARCHAR2,
p_rptname IN VARCHAR2,
p_user IN VARCHAR2,
p_out_col_pref OUT sys_refcursor,
p_err_cd OUT NUMBER,
p_err_msg OUT VARCHAR2
)
IS
p_check BOOLEAN := true;
p_val NUMBER;
BEGIN
BEGIN
SELECT p3.col_grp_id
INTO p_val
FROM co_page_t p1,
co_page_col_grp_t p2,
co_page_col_grp_user_t p3
WHERE p1.page_id = p2.page_id AND p3.security_userid = p_user;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
p_check := false;
END;
OPEN p_out_col_pref FOR
SELECT p1.page_id, p2.col_grp_nm, p3.col_grp_id,p_check
FROM co_page_t p1,
co_page_col_grp_t p2,
co_page_col_grp_user_t p3
WHERE p1.page_id = p2.page_id
AND p2.col_grp_id = p3.col_grp_id
AND p1.page_nm = p_rptname
AND p1.appl_cd = p_applcd;
END;
p_check 是返回错误的布尔值。
PLS-00382: expression is of wrong type
请建议我如何纠正这个