DBA Data[Home] [Help]

PACKAGE BODY: APPS.EDW_DEMAND_CLASS_PKG

Source


1 PACKAGE BODY edw_demand_class_pkg AS
2 /*$Header: ISCSCA0B.pls 115.4 2002/12/13 22:25:09 blindaue ship $*/
3 FUNCTION get_demand_class_fk (
4 	p_demand_class_code in VARCHAR2,
5 	p_instance_code in VARCHAR2 := NULL) RETURN VARCHAR2 IS
6   l_demand_class_fk VARCHAR2(240) := 'NA_EDW';
7   l_instance VARCHAR2(30) := NULL;
8 
9 BEGIN
10 
11   IF (p_demand_class_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_demand_class_fk := p_demand_class_code || '-' || l_instance;
23 
24   return (l_demand_class_fk);
25 
26 EXCEPTION when others then
27   return 'NA_EDW';
28 
29 END get_demand_class_fk;
30 END;