The below query will retrieve more than one col_grp_id
SELECT col_grp_id
FROM co_page_col_grp_user_t
WHERE page_id=p_page_id AND security_userid = p_user;
p_check is a user defined variable which should be either string "true" or "false".
It is "false" when the value is present in the first query else it should be "true" . I need to pass all the rows by using refcursor with p_check added in it
OPEN p_out_col_pref FOR
SELECT page_id,col_grp_nm,col_grp_id,p_check
FROM (SELECT p1.page_id, p2.col_grp_nm, p2.col_grp_id, p_check
FROM co_page_t p1,
co_page_col_grp_t p2
WHERE p1.page_id = p2.page_id
AND p1.page_nm = p_rptname
AND p1.appl_cd = p_applcd
AND p1.page_id = p_page_id);
How to do this query??