DBA Data[Home] [Help]

PACKAGE BODY: APPS.JAI_PA_SETUP_DEF_PKG

Source


1 package body jai_pa_setup_def_pkg  as
2 /* $Header: jai_pa_setup_def_pkg.plb 120.1 2009/04/24 07:37:42 mbremkum noship $ */
3 
4 procedure default_pa_setup_org (errbuf               out nocopy varchar2,
5                                 retcode              out nocopy varchar2,
6                                 p_org_id             in  number)
7 is
8 cursor c_get_pa_count
9 is
10 select count(setup_value_id)
11 from jai_pa_setup_values
12 where org_id is not null;
13 l_count number;
14 begin
15 fnd_file.put_line(fnd_file.log, 'Updating org_id for existing setup');
16 open c_get_pa_count;
17 fetch c_get_pa_count into l_count;
18 close c_get_pa_count;
19 if l_count > 0 then
20    fnd_file.put_line(fnd_file.log, 'Records exist in jai_pa_setup_values with org_id');
21    fnd_file.put_line(fnd_file.log, 'Cannot update. Exiting...');
22    return;
23 else
24    update jai_pa_setup_values
25    set org_id = p_org_id
26    where org_id is null;
27    fnd_file.put_line(fnd_file.log, 'Updated existing records with org_id...');
28 end if;
29 retcode := 1 ;
30 errbuf := 'Normal Completion';
31 exception
32   when others then
33      rollback;
34      retcode := 2 ;
35      errbuf := 'Exception - ' || sqlerrm;
36 end;
37 
38 end;