prompt Package Body: jr_vn create or replace package body jr_vn is ------------------------------------------------ -- * Package : Private data/methods * ------------------------------------------------ ------------------------------------------------ -- Procedure : put_line ------------------------------------------------ procedure put_line(msg varchar2) is begin jr_reg_io.put_line(msg); end put_line; ------------------------------------------------ -- * Public methods * ------------------------------------------------ -------------------------------------------------------------------------- -- Function : context -- -- This function is defined to be used by the version resolved views as a -- function predicate rather than a subquery. -- This is designed to workaround bug 762065 (queries using CONNECT BY) -- Sourced from patch ci0406.014 -------------------------------------------------------------------------- function context ( ivid number , is_container varchar2 default 'N' ) return integer is dummy pls_integer; se varchar2(1); begin if jr_context.workarea is null then select /*VN Resolution subquery, no workarea ctxt*/ max(1) into dummy from i$sdd_object_versions ov where ov.ivid = context.ivid and ov.wastebasket = jr_context.wastebasket ; else select /*VN Resolution subquery, workarea ctxt*/ max(1) into dummy from i$sdd_wa_context ctxt where ctxt.object_ivid = context.ivid and ctxt.workarea_irid = jr_context.workarea and ctxt.wastebasket = jr_context.wastebasket ; end if; if dummy > 0 and is_container = 'Y'then -- If container is in our wa, check we have select ar on it if jr_acc_rights.can_sel(ivid, is_container) = 'Y' then return dummy; else return 0; end if; else -- Only check access rights for containers.... return dummy; end if; end context; end jr_vn; /