618:
619: IF(l_count > 0) THEN
620: l_Sql := 'ALTER VIEW '|| p_level_view_name ||' COMPILE';
621:
622: BSC_APPS.Do_Ddl_AT(l_Sql, ad_ddl.alter_view, p_level_view_name, BSC_APPS.fnd_apps_schema, BSC_APPS.bsc_apps_short_name);
623: END IF;
624:
625: EXCEPTION
626: WHEN OTHERS THEN
3104: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 7001, 200));
3105: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 7201, 200));
3106: --DBMS_OUTPUT.PUT_LINE('---------CREATION OF DUMMY MASTER TABLE---------');
3107:
3108: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_table, l_dummy_table);
3109:
3110: --DBMS_OUTPUT.PUT_LINE('---------DROP MASTER TABLE----------');
3111: l_sql_stmt := ' SELECT COUNT(*) FROM USER_OBJECTS '||
3112: ' WHERE OBJECT_NAME = :1';
3115:
3116: IF (l_count <> 0) THEN
3117: l_sql_stmt := 'DROP TABLE '||l_master_table;
3118: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3119: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.drop_table, l_master_table);
3120: END IF;
3121:
3122: --DBMS_OUTPUT.PUT_LINE('---------CREATION OF MASTER TABLE---------');
3123: l_sql_stmt := 'CREATE TABLE '||l_master_table||' '||' TABLESPACE '||
3126:
3127:
3128: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3129:
3130: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_table, l_master_table);
3131:
3132: --DBMS_OUTPUT.PUT_LINE('---------DROP DUMMY TABLE---------');
3133: l_sql_stmt := 'Drop Table '||l_dummy_table;
3134: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.drop_table, l_dummy_table);
3130: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_table, l_master_table);
3131:
3132: --DBMS_OUTPUT.PUT_LINE('---------DROP DUMMY TABLE---------');
3133: l_sql_stmt := 'Drop Table '||l_dummy_table;
3134: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.drop_table, l_dummy_table);
3135:
3136:
3137: --DBMS_OUTPUT.PUT_LINE('---------CREATION OF INDEXS ON MASTER TABLE---------');
3138: l_sql_stmt := ' CREATE UNIQUE INDEX '||l_master_table||'_U1 '||
3138: l_sql_stmt := ' CREATE UNIQUE INDEX '||l_master_table||'_U1 '||
3139: ' ON '||l_master_table||' (CODE,LANGUAGE) '||' '||
3140: ' TABLESPACE '||BSC_APPS.Get_Tablespace_Name(BSC_APPS.Dimension_Index_Tbs_Type)||' '||BSC_APPS.bsc_storage_clause;
3141: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3142: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_index, l_master_table);
3143:
3144: -- Create a new UNIQUE INDEX for Loader Performance - Bug #3090828
3145: l_sql_stmt := ' CREATE UNIQUE INDEX '||l_master_table||'_U2 '||
3146: ' ON '||l_master_table||' (USER_CODE,LANGUAGE) '||' '||
3145: l_sql_stmt := ' CREATE UNIQUE INDEX '||l_master_table||'_U2 '||
3146: ' ON '||l_master_table||' (USER_CODE,LANGUAGE) '||' '||
3147: ' TABLESPACE '||BSC_APPS.Get_Tablespace_Name(BSC_APPS.Dimension_Index_Tbs_Type)||' '||BSC_APPS.bsc_storage_clause;
3148: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3149: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_index, l_master_table);
3150:
3151: --DBMS_OUTPUT.PUT_LINE('---------CREATION OF INDEXS ON MASTER TABLE LOADER BUG #3120190---------');
3152: FOR i IN 0..(l_index_Table.COUNT-1) LOOP
3153: --DBMS_OUTPUT.PUT_LINE('l_index_Table('||i||').p_Column_Name '||l_index_Table(i).p_Column_Name);
3158: l_sql_stmt := ' CREATE INDEX '||l_master_table||'_N'||(i+1)||' '||
3159: ' ON '||l_master_table||' ('||l_index_Table(i).p_Column_Name||') '||' '||
3160: ' TABLESPACE '||BSC_APPS.Get_Tablespace_Name(BSC_APPS.Dimension_Index_Tbs_Type)||' '||BSC_APPS.bsc_storage_clause;
3161: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3162: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_index, l_master_table);
3163: ELSE
3164: EXIT;
3165: END IF;
3166: END LOOP;
3174:
3175: IF (l_count <> 0) THEN
3176: l_sql_stmt := 'DROP TABLE '||l_input_table;
3177: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3178: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.drop_table, l_input_table);
3179: END IF;
3180: l_sql_stmt := ' CREATE TABLE '||l_input_table||' '||' TABLESPACE '||
3181: BSC_APPS.Get_Tablespace_Name(BSC_APPS.Input_Table_Tbs_Type)||' '||BSC_APPS.bsc_storage_clause||
3182: ' AS SELECT '||l_input_col_names||' FROM '||l_master_table||' WHERE 1 = 2';
3198: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 2801, 200));
3199: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 3001, 200));
3200: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 3201, 200));
3201:
3202: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_table, l_input_table);
3203:
3204: l_sql_stmt := ' CREATE UNIQUE INDEX '||l_input_table||'_U1 '||
3205: ' ON '||l_input_table||' (USER_CODE) '||' '||
3206: ' TABLESPACE '||BSC_APPS.Get_Tablespace_Name(BSC_APPS.Input_Index_Tbs_Type)||' '||BSC_APPS.bsc_storage_clause;
3204: l_sql_stmt := ' CREATE UNIQUE INDEX '||l_input_table||'_U1 '||
3205: ' ON '||l_input_table||' (USER_CODE) '||' '||
3206: ' TABLESPACE '||BSC_APPS.Get_Tablespace_Name(BSC_APPS.Input_Index_Tbs_Type)||' '||BSC_APPS.bsc_storage_clause;
3207: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3208: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_index, l_input_table);
3209:
3210: --create dynamic view for modified master table
3211: --DBMS_OUTPUT.PUT_LINE('---------GENERATION OF VIEW BASED ON MASTER TABLE---------');
3212: l_sql_stmt := ' CREATE OR REPLACE VIEW '||l_view_name||' AS (' ||
3213: ' SELECT '||l_view_columns||
3214: ' FROM '||l_master_table||
3215: ' WHERE LANGUAGE = USERENV(''LANG''))';
3216: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3217: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_view, l_view_name);
3218:
3219: /************************************************************************
3220: Child dimension object table will contain the columns of the parent
3221: dimension object and will be added or removed.So after the creation of the new
3411:
3412: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||SUBSTR(l_sql_stmt, 1, 200)||'>');
3413: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||SUBSTR(l_sql_stmt, 201, 200)||'>');
3414:
3415: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_table, l_master_table);
3416: END IF;
3417: --DBMS_OUTPUT.PUT_LINE('l_input_table <'||l_input_table||'>');
3418: --DBMS_OUTPUT.PUT_LINE('---------CREATION OF INPUT TABLE---------');
3419: l_sql_stmt := ' SELECT COUNT(*) FROM USER_OBJECTS '||
3433: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 201, 200));
3434: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 401, 200));
3435: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 601, 200));
3436: --DBMS_OUTPUT.PUT_LINE(SUBSTR(l_sql_stmt, 801, 200));
3437: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.create_table, l_input_table);
3438: END IF;
3439: --insert into BSC_DB_TABLES_RELS & BSC_DB_TABLES
3440: --DBMS_OUTPUT.PUT_LINE('INSERT INTO BSC_DB_TABLES_RELS');
3441: SELECT COUNT(*) INTO l_count
3572: EXECUTE IMMEDIATE l_sql_stmt INTO l_count USING l_master_table;
3573: IF (l_count <> 0) THEN
3574: l_sql_stmt := 'DROP TABLE '||l_master_table;
3575: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3576: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.drop_table, l_master_table);
3577: END IF;
3578: l_sql_stmt := ' SELECT COUNT(*) FROM USER_OBJECTS '||
3579: ' WHERE OBJECT_NAME = :1';
3580: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3581: EXECUTE IMMEDIATE l_sql_stmt INTO l_count USING l_input_table;
3582: IF (l_count <> 0) THEN
3583: l_sql_stmt := 'DROP TABLE '||l_input_table;
3584: --DBMS_OUTPUT.PUT_LINE('l_sql_stmt <'||l_sql_stmt||'>');
3585: BSC_APPS.DO_DDL(l_sql_stmt, ad_ddl.drop_table, l_input_table);
3586: END IF;
3587: --DBMS_OUTPUT.PUT_LINE('DELETE TABLES BSC_DB_TABLES '||l_input_table);
3588: DELETE FROM BSC_DB_TABLES
3589: WHERE Table_Name = l_input_table;