14: p_id IN NUMBER := NULL,
15: p_instance_code IN VARCHAR2 := NULL
16: ) return VARCHAR2 IS
17: --
18: l_instance_code edw_local_instance.instance_code%type;
19: --
20: l_org_fk VARCHAR2(240) := 'NA_EDW';
21: --
22: cursor csr_instance is
20: l_org_fk VARCHAR2(240) := 'NA_EDW';
21: --
22: cursor csr_instance is
23: select instance_code
24: from edw_local_instance;
25: BEGIN
26: --
27: if p_id is null then
28: --
75: p_instance_code IN VARCHAR2 := NULL
76: ) return VARCHAR2 IS
77: --
78: l_check_flag VARCHAR2(1) := 'N';
79: l_instance_code edw_local_instance.instance_code%type;
80: l_ou_fk VARCHAR2(240) := 'NA_EDW';
81: --
82: cursor csr_check_ou is
83: select 'Y'
88: and oi.organization_id = p_id;
89: --
90: cursor csr_instance is
91: select instance_code
92: from edw_local_instance;
93: --
94: BEGIN
95: --
96: if p_id is null then