[Home] [Help]
PACKAGE BODY: APPS.EDW_SALES_CHANNEL_PKG
Source
1 PACKAGE BODY edw_sales_channel_pkg AS
2 /*$Header: ISCSCA3B.pls 115.3 2002/12/19 00:10:54 scheung ship $*/
3 FUNCTION get_sales_channel_fk (
4 p_sales_channel_code in VARCHAR2,
5 p_instance_code in VARCHAR2 := NULL) RETURN VARCHAR2 IS
6 l_sales_channel_fk VARCHAR2(240) := 'NA_EDW';
7 l_instance VARCHAR2(30) := NULL;
8
9 BEGIN
10
11 IF (p_sales_channel_code is null) then
12 return 'NA_EDW';
13 END IF;
14
15 IF (p_instance_code is NOT NULL) then
16 l_instance := p_instance_code;
17 ELSE
18 select instance_code into l_instance
19 from edw_local_instance;
20 END IF;
21
22 l_sales_channel_fk := p_sales_channel_code || '-' || l_instance;
23
24 return l_sales_channel_fk;
25
26 EXCEPTION when others then
27 return 'NA_EDW';
28
29 END get_sales_channel_fk;
30 end;