47: SELECT ra.access_type
48: FROM
49: JTF_TTY_GEO_TERR_RSC grsc
50: , jtf_tty_geo_terr gtr
51: , jtf_tty_terr_grp_roles tgr
52: , jtf_tty_role_access ra
53: WHERE grsc.GEO_TERRITORY_ID = l_geo_terr_id
54: AND gtr.geo_territory_id = grsc.geo_territory_id
55: AND grsc.rsc_role_code = tgr.role_code
60: /* Cursor to find Role Code */
61: CURSOR c_role_code(l_terr_group_id NUMBER) IS
62: SELECT b.role_code role_code
63: ,b.terr_group_id
64: FROM jtf_tty_terr_grp_roles b
65: WHERE
66: b.terr_group_id = l_terr_group_id
67: ORDER BY b.role_code;
68:
82: CURSOR c_role_access( lp_terr_group_id NUMBER
83: , lp_role VARCHAR2) IS
84: SELECT DISTINCT a.access_type
85: FROM jtf_tty_role_access a
86: , jtf_tty_terr_grp_roles b
87: WHERE a.terr_group_role_id = b.terr_group_role_id
88: AND b.terr_group_id = lp_terr_group_id
89: AND b.role_code = lp_role;
90: