1 PACKAGE BODY GMF_MTL_GET_ORG_ID as
2 /* $Header: gmforgib.pls 115.1 2002/10/29 22:03:27 jdiiorio ship $ */
3 CURSOR cur_inv_get_org_code(st_date date, en_date date,
4 pm_lookup_cd varchar2, ship_to_loc_id number) IS
5 SELECT o.organization_code from
6 org_organization_definitions o
7 WHERE organization_id > 0;
8
9 PROCEDURE proc_inv_get_org_id (
10 st_date in out nocopy date,
11 en_date in out nocopy date,
12 pm_lookup_cd in out nocopy varchar2,
13 ship_to_loc_id in out nocopy number,
14 inv_org_id in out nocopy varchar2,
15 row_to_fetch in number,
16 error_status out nocopy number) IS
17
18 Begin /* Beginning of procedure proc_gl_get_sob_id */
19 IF NOT cur_inv_get_org_code%ISOPEN THEN
20 OPEN cur_inv_get_org_code(st_date, en_date, pm_lookup_cd,
21 ship_to_loc_id);
22 END IF;
23
24 FETCH cur_inv_get_org_code
25 INTO inv_org_id;
26
27 if cur_inv_get_org_code%NOTFOUND then
28 error_status := 100;
29 end if;
30 if (cur_inv_get_org_code%NOTFOUND) or row_to_fetch = 1 THEN
31 CLOSE cur_inv_get_org_code;
32 end if;
33
34 exception
35
36 when others then
37 error_status := SQLCODE;
38
39 END; /* End of procedure proc_inv_get_org_id */
40
41 END GMF_MTL_GET_ORG_ID; -- END GMF_MTL_GET_ORG_ID