DBA Data[Home] [Help]

PACKAGE BODY: APPS.FND_DATADICT_PKG

Source


1 PACKAGE BODY fnd_datadict_pkg AS
2 /* $Header: AFUDICTB.pls 120.2 2005/09/22 19:24:51 rsheh ship $ */
3 
4 PROCEDURE rename_table(p_appl_id       IN number,
5                        p_old_tablename IN varchar2,
6                        p_new_tablename IN varchar2) IS
7   l_numrows   varchar2(50);
8   colnames fnd_dictionary_pkg.namearraytyp;
9   pkname varchar2(30);
10   pkvalue_old fnd_dictionary_pkg.namearraytyp;
11   pkvalue_new fnd_dictionary_pkg.namearraytyp;
12 
13   ret boolean;
14 BEGIN
15 
16     --
17     -- Update AOL dictionary tables for renamed tables
18     --     FND_TABLES, FND_DESCRIPTIVE_FLEXS, FND_DOC_SEQUENCE_CATEGORIES
19     --
20     IF (length(p_new_tablename) > 30 OR
21         length(p_old_tablename) > 30) THEN
22         raise_application_error(-20001,
23                              'Invalid table names : '||p_old_tablename||
24                              '->'||p_new_tablename);
25     END IF;
26 
27 /* Bug 4462304 */
28 /* Comment these following manual updates cause we have API to do that now */
29 /*
30     update fnd_tables
31     set   table_name = p_new_tablename
32           , user_table_name = p_new_tablename
33     where table_name = p_old_tablename
34     and   application_id = p_appl_id;
35 
36     l_numrows := SQL%ROWCOUNT;
37 
38     update fnd_descriptive_flexs
39     set   application_table_name = p_new_tablename
40     where application_table_name = p_old_tablename
41     and   table_application_id = p_appl_id;
42 
43     l_numrows := l_numrows||','||SQL%ROWCOUNT;
44 
45     update fnd_id_flexs
46     set   application_table_name = p_new_tablename
47     where application_table_name = p_old_tablename
48     and   table_application_id = p_appl_id;
49 
50     l_numrows := l_numrows||','||SQL%ROWCOUNT;
51 
52     update fnd_doc_sequence_categories
53     set   table_name = p_new_tablename
54     where table_name = p_old_tablename
55     and   application_id = p_appl_id;
56 
57     l_numrows := l_numrows||','||SQL%ROWCOUNT;
58 
59 */
60 
61   /* Start Bug 4462304 */
62   colnames(0) := 'APPLICATION_ID';
63   colnames(1) := 'TABLE_NAME';
64   colnames(1) := null;
65   pkvalue_old(0) := p_appl_id;
66   pkvalue_old(1) := p_old_tablename;
67   pkvalue_old(2) := null;
68   pkvalue_new(0) := p_appl_id;
69   pkvalue_new(1) := p_new_tablename;
70   pkvalue_new(2) := null;
71 
72   ret := fnd_dictionary_pkg.updatepkcolumns('FND','FND_TABLES',
73                                    colnames, pkvalue_old, pkvalue_new);
74   /* End Bug 4462304 */
75 
76 END;
77 
78 END;