29:
30: --get the long names
31: IF get_long_names = FALSE
32: THEN
33: fnd_message.set_name ('BIS', 'EDW_CDI_NO_LONG_DIM');
34: errbuf := fnd_message.get;
35: write_to_out (errbuf);
36: --errbuf:='Could not get long names for the dimensions. Stopping Data Check';
37: retcode := '2';
30: --get the long names
31: IF get_long_names = FALSE
32: THEN
33: fnd_message.set_name ('BIS', 'EDW_CDI_NO_LONG_DIM');
34: errbuf := fnd_message.get;
35: write_to_out (errbuf);
36: --errbuf:='Could not get long names for the dimensions. Stopping Data Check';
37: retcode := '2';
38: RETURN;
174:
175: write_to_out_log_n (
176: '--------------------------------------------------'
177: );
178: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
179: write_to_out_log ( fnd_message.get
180: || ' '
181: || l_dim_long_name);
182: write_to_out_log ('--------------------------------------------------');
175: write_to_out_log_n (
176: '--------------------------------------------------'
177: );
178: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
179: write_to_out_log ( fnd_message.get
180: || ' '
181: || l_dim_long_name);
182: write_to_out_log ('--------------------------------------------------');
183: write_to_out_log (' ');
279: CLOSE cv;
280:
281: IF g_number_lstg_tables = 0
282: THEN
283: fnd_message.set_name ('BIS', 'EDW_CDI_NO_IT_TABLE_FOUND');
284: write_to_out_log_n (fnd_message.get);
285: --write_to_out_log_n('No Interface tables found. Aborting Data Check.');
286: RAISE g_stg_tables_not_found;
287: -- RETURN TRUE;
280:
281: IF g_number_lstg_tables = 0
282: THEN
283: fnd_message.set_name ('BIS', 'EDW_CDI_NO_IT_TABLE_FOUND');
284: write_to_out_log_n (fnd_message.get);
285: --write_to_out_log_n('No Interface tables found. Aborting Data Check.');
286: RAISE g_stg_tables_not_found;
287: -- RETURN TRUE;
288: END IF;
1181:
1182: l_owner VARCHAR2 (400);
1183: BEGIN
1184: write_to_out (' ');
1185: fnd_message.set_name ('BIS', 'EDW_CDI_TOTAL_RECORDS');
1186: write_to_out (fnd_message.get);
1187: --write_to_out('Total number of records in the interface tables with status of ');
1188: --write_to_out('''READY'',''DANGLING'' or ''DUPLICATE''');
1189: write_to_out (' ');
1182: l_owner VARCHAR2 (400);
1183: BEGIN
1184: write_to_out (' ');
1185: fnd_message.set_name ('BIS', 'EDW_CDI_TOTAL_RECORDS');
1186: write_to_out (fnd_message.get);
1187: --write_to_out('Total number of records in the interface tables with status of ');
1188: --write_to_out('''READY'',''DANGLING'' or ''DUPLICATE''');
1189: write_to_out (' ');
1190: l_owner := edw_owb_collection_util.get_table_owner (p_dim_name);
1257: || get_time
1258: );
1259: END IF;
1260:
1261: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
1262: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1263: fnd_message.set_token ('RECORDS', g_lstg_total_records (i));
1264: write_to_out (fnd_message.get);
1265: --write_to_out('Table '||g_lstg_table_long_name(i)||' has '||g_lstg_total_records(i)||' records');
1258: );
1259: END IF;
1260:
1261: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
1262: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1263: fnd_message.set_token ('RECORDS', g_lstg_total_records (i));
1264: write_to_out (fnd_message.get);
1265: --write_to_out('Table '||g_lstg_table_long_name(i)||' has '||g_lstg_total_records(i)||' records');
1266: edw_owb_collection_util.analyze_table_stats (
1259: END IF;
1260:
1261: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
1262: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1263: fnd_message.set_token ('RECORDS', g_lstg_total_records (i));
1264: write_to_out (fnd_message.get);
1265: --write_to_out('Table '||g_lstg_table_long_name(i)||' has '||g_lstg_total_records(i)||' records');
1266: edw_owb_collection_util.analyze_table_stats (
1267: SUBSTR (
1260:
1261: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
1262: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1263: fnd_message.set_token ('RECORDS', g_lstg_total_records (i));
1264: write_to_out (fnd_message.get);
1265: --write_to_out('Table '||g_lstg_table_long_name(i)||' has '||g_lstg_total_records(i)||' records');
1266: edw_owb_collection_util.analyze_table_stats (
1267: SUBSTR (
1268: g_lstg_pk_table (i),
1303: l_dup_count edw_owb_collection_util.numbertabletype;
1304: l_number_dup_str NUMBER;
1305: BEGIN
1306: write_to_out (' ');
1307: fnd_message.set_name ('BIS', 'EDW_CDI_DUPLICATE_DATA_CHECK');
1308: write_to_out (fnd_message.get);
1309:
1310: --write_to_out('Duplicate Data Check ');
1311: FOR i IN 1 .. g_number_lstg_tables
1304: l_number_dup_str NUMBER;
1305: BEGIN
1306: write_to_out (' ');
1307: fnd_message.set_name ('BIS', 'EDW_CDI_DUPLICATE_DATA_CHECK');
1308: write_to_out (fnd_message.get);
1309:
1310: --write_to_out('Duplicate Data Check ');
1311: FOR i IN 1 .. g_number_lstg_tables
1312: LOOP
1311: FOR i IN 1 .. g_number_lstg_tables
1312: LOOP
1313: IF g_lstg_total_records (i) = 0
1314: THEN
1315: fnd_message.set_name ('BIS', 'EDW_CDI_NO_READY_RECORDS');
1316: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1317: write_to_out (fnd_message.get);
1318: --write_to_out('Table '||g_lstg_table_long_name(i)||' has no records with status of ');
1319: --write_to_out('''READY'',''DANGLING'' or ''DUPLICATE''.');
1312: LOOP
1313: IF g_lstg_total_records (i) = 0
1314: THEN
1315: fnd_message.set_name ('BIS', 'EDW_CDI_NO_READY_RECORDS');
1316: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1317: write_to_out (fnd_message.get);
1318: --write_to_out('Table '||g_lstg_table_long_name(i)||' has no records with status of ');
1319: --write_to_out('''READY'',''DANGLING'' or ''DUPLICATE''.');
1320: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DUP_DATA_CHECK');
1313: IF g_lstg_total_records (i) = 0
1314: THEN
1315: fnd_message.set_name ('BIS', 'EDW_CDI_NO_READY_RECORDS');
1316: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1317: write_to_out (fnd_message.get);
1318: --write_to_out('Table '||g_lstg_table_long_name(i)||' has no records with status of ');
1319: --write_to_out('''READY'',''DANGLING'' or ''DUPLICATE''.');
1320: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DUP_DATA_CHECK');
1321: write_to_out (fnd_message.get);
1316: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1317: write_to_out (fnd_message.get);
1318: --write_to_out('Table '||g_lstg_table_long_name(i)||' has no records with status of ');
1319: --write_to_out('''READY'',''DANGLING'' or ''DUPLICATE''.');
1320: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DUP_DATA_CHECK');
1321: write_to_out (fnd_message.get);
1322: --write_to_out('No duplicate check done');
1323: RETURN TRUE;
1324: END IF;
1317: write_to_out (fnd_message.get);
1318: --write_to_out('Table '||g_lstg_table_long_name(i)||' has no records with status of ');
1319: --write_to_out('''READY'',''DANGLING'' or ''DUPLICATE''.');
1320: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DUP_DATA_CHECK');
1321: write_to_out (fnd_message.get);
1322: --write_to_out('No duplicate check done');
1323: RETURN TRUE;
1324: END IF;
1325:
1400:
1401: OPEN cv FOR l_stmt;
1402: FETCH cv INTO l_num_dup;
1403: CLOSE cv;
1404: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
1405: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1406: fnd_message.set_token ('DUPLICATE', NVL (l_num_dup, 0));
1407: fnd_message.set_token ('TOTAL', g_lstg_total_records (i));
1408: write_to_out (fnd_message.get);
1401: OPEN cv FOR l_stmt;
1402: FETCH cv INTO l_num_dup;
1403: CLOSE cv;
1404: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
1405: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1406: fnd_message.set_token ('DUPLICATE', NVL (l_num_dup, 0));
1407: fnd_message.set_token ('TOTAL', g_lstg_total_records (i));
1408: write_to_out (fnd_message.get);
1409:
1402: FETCH cv INTO l_num_dup;
1403: CLOSE cv;
1404: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
1405: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1406: fnd_message.set_token ('DUPLICATE', NVL (l_num_dup, 0));
1407: fnd_message.set_token ('TOTAL', g_lstg_total_records (i));
1408: write_to_out (fnd_message.get);
1409:
1410: --if l_num_dup is null then
1403: CLOSE cv;
1404: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
1405: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1406: fnd_message.set_token ('DUPLICATE', NVL (l_num_dup, 0));
1407: fnd_message.set_token ('TOTAL', g_lstg_total_records (i));
1408: write_to_out (fnd_message.get);
1409:
1410: --if l_num_dup is null then
1411: --write_to_out('Table '||g_lstg_table_long_name(i)||' 0 records are duplicate ');
1404: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
1405: fnd_message.set_token ('TABLE', g_lstg_table_long_name (i));
1406: fnd_message.set_token ('DUPLICATE', NVL (l_num_dup, 0));
1407: fnd_message.set_token ('TOTAL', g_lstg_total_records (i));
1408: write_to_out (fnd_message.get);
1409:
1410: --if l_num_dup is null then
1411: --write_to_out('Table '||g_lstg_table_long_name(i)||' 0 records are duplicate ');
1412: --else
1460: || get_time);
1461: END IF;
1462:
1463: write_to_out (' ');
1464: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DUPLICATE');
1465: write_to_out (fnd_message.get);
1466: --write_to_out('Sample duplicate records and their count');
1467: OPEN cv FOR l_stmt;
1468:
1461: END IF;
1462:
1463: write_to_out (' ');
1464: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DUPLICATE');
1465: write_to_out (fnd_message.get);
1466: --write_to_out('Sample duplicate records and their count');
1467: OPEN cv FOR l_stmt;
1468:
1469: LOOP
1895: END LOOP;
1896: END IF;
1897:
1898: write_to_out (' ');
1899: fnd_message.set_name ('BIS', 'EDW_CDI_DANGLING_CHECK_IT');
1900: write_to_out (fnd_message.get);
1901: --write_to_out('Dangling Records Check against parent LSTG Tables');
1902: write_to_out (' ');
1903:
1896: END IF;
1897:
1898: write_to_out (' ');
1899: fnd_message.set_name ('BIS', 'EDW_CDI_DANGLING_CHECK_IT');
1900: write_to_out (fnd_message.get);
1901: --write_to_out('Dangling Records Check against parent LSTG Tables');
1902: write_to_out (' ');
1903:
1904: FOR i IN 1 .. g_number_hier_distinct
1904: FOR i IN 1 .. g_number_hier_distinct
1905: LOOP
1906: write_to_out (' ');
1907: write_to_out (' ');
1908: fnd_message.set_name ('BIS', 'EDW_CDI_HIERARCHY');
1909: fnd_message.set_token ('HIER', g_hier_distinct (i));
1910: write_to_out (fnd_message.get);
1911:
1912: --write_to_out('Hierarchy '||g_hier_distinct(i));
1905: LOOP
1906: write_to_out (' ');
1907: write_to_out (' ');
1908: fnd_message.set_name ('BIS', 'EDW_CDI_HIERARCHY');
1909: fnd_message.set_token ('HIER', g_hier_distinct (i));
1910: write_to_out (fnd_message.get);
1911:
1912: --write_to_out('Hierarchy '||g_hier_distinct(i));
1913: FOR j IN 1 .. g_lstg_fk_number
1906: write_to_out (' ');
1907: write_to_out (' ');
1908: fnd_message.set_name ('BIS', 'EDW_CDI_HIERARCHY');
1909: fnd_message.set_token ('HIER', g_hier_distinct (i));
1910: write_to_out (fnd_message.get);
1911:
1912: --write_to_out('Hierarchy '||g_hier_distinct(i));
1913: FOR j IN 1 .. g_lstg_fk_number
1914: LOOP
2076: THEN
2077: IF g_parent_lstg_fk_table (j) = 'ALL'
2078: THEN
2079: write_to_out (' ');
2080: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2081: fnd_message.set_token (
2082: 'TABLE',
2083: l_lstg_fk_table_long (j)
2084: );
2077: IF g_parent_lstg_fk_table (j) = 'ALL'
2078: THEN
2079: write_to_out (' ');
2080: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2081: fnd_message.set_token (
2082: 'TABLE',
2083: l_lstg_fk_table_long (j)
2084: );
2085: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2081: fnd_message.set_token (
2082: 'TABLE',
2083: l_lstg_fk_table_long (j)
2084: );
2085: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2086: write_to_out (fnd_message.get);
2087:
2088: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2089: IF g_results_table_flag
2082: 'TABLE',
2083: l_lstg_fk_table_long (j)
2084: );
2085: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2086: write_to_out (fnd_message.get);
2087:
2088: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2089: IF g_results_table_flag
2090: THEN
2113: END IF;
2114: END IF;
2115: ELSE
2116: write_to_out (' ');
2117: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2118: fnd_message.set_token (
2119: 'TABLE',
2120: l_lstg_fk_table_long (j)
2121: );
2114: END IF;
2115: ELSE
2116: write_to_out (' ');
2117: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2118: fnd_message.set_token (
2119: 'TABLE',
2120: l_lstg_fk_table_long (j)
2121: );
2122: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2118: fnd_message.set_token (
2119: 'TABLE',
2120: l_lstg_fk_table_long (j)
2121: );
2122: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2123: write_to_out (fnd_message.get);
2124: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2125: fnd_message.set_name (
2126: 'BIS',
2119: 'TABLE',
2120: l_lstg_fk_table_long (j)
2121: );
2122: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2123: write_to_out (fnd_message.get);
2124: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2125: fnd_message.set_name (
2126: 'BIS',
2127: 'EDW_CDI_PARENT_TABLE_AND_PK'
2121: );
2122: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2123: write_to_out (fnd_message.get);
2124: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2125: fnd_message.set_name (
2126: 'BIS',
2127: 'EDW_CDI_PARENT_TABLE_AND_PK'
2128: );
2129: fnd_message.set_token (
2125: fnd_message.set_name (
2126: 'BIS',
2127: 'EDW_CDI_PARENT_TABLE_AND_PK'
2128: );
2129: fnd_message.set_token (
2130: 'TABLE',
2131: get_lstg_long_name (g_parent_lstg_fk_table (j))
2132: );
2133: fnd_message.set_token (
2129: fnd_message.set_token (
2130: 'TABLE',
2131: get_lstg_long_name (g_parent_lstg_fk_table (j))
2132: );
2133: fnd_message.set_token (
2134: 'PK',
2135: get_lstg_pk (g_parent_lstg_fk_table (j))
2136: );
2137: write_to_out (fnd_message.get);
2133: fnd_message.set_token (
2134: 'PK',
2135: get_lstg_pk (g_parent_lstg_fk_table (j))
2136: );
2137: write_to_out (fnd_message.get);
2138:
2139: --write_to_out('Parent Table '||get_lstg_long_name(g_parent_lstg_fk_table(j))||
2140: --', Primary Key '||get_lstg_pk(g_parent_lstg_fk_table(j)));
2141: IF g_results_table_flag
2167: END IF;
2168: END IF;
2169: END IF;
2170:
2171: fnd_message.set_name ('BIS', 'EDW_CDI_NO_RECS_DANGLING');
2172: write_to_out (fnd_message.get);
2173: --write_to_out(' 0 records are dangling');
2174: ELSE
2175: IF g_parent_lstg_fk_table (j) = 'ALL'
2168: END IF;
2169: END IF;
2170:
2171: fnd_message.set_name ('BIS', 'EDW_CDI_NO_RECS_DANGLING');
2172: write_to_out (fnd_message.get);
2173: --write_to_out(' 0 records are dangling');
2174: ELSE
2175: IF g_parent_lstg_fk_table (j) = 'ALL'
2176: THEN
2174: ELSE
2175: IF g_parent_lstg_fk_table (j) = 'ALL'
2176: THEN
2177: write_to_out (' ');
2178: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2179: fnd_message.set_token (
2180: 'TABLE',
2181: l_lstg_fk_table_long (j)
2182: );
2175: IF g_parent_lstg_fk_table (j) = 'ALL'
2176: THEN
2177: write_to_out (' ');
2178: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2179: fnd_message.set_token (
2180: 'TABLE',
2181: l_lstg_fk_table_long (j)
2182: );
2183: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2179: fnd_message.set_token (
2180: 'TABLE',
2181: l_lstg_fk_table_long (j)
2182: );
2183: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2184: write_to_out (fnd_message.get);
2185:
2186: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2187: IF g_results_table_flag
2180: 'TABLE',
2181: l_lstg_fk_table_long (j)
2182: );
2183: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2184: write_to_out (fnd_message.get);
2185:
2186: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2187: IF g_results_table_flag
2188: THEN
2211: END IF;
2212: END IF;
2213: ELSE
2214: write_to_out (' ');
2215: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2216: fnd_message.set_token (
2217: 'TABLE',
2218: l_lstg_fk_table_long (j)
2219: );
2212: END IF;
2213: ELSE
2214: write_to_out (' ');
2215: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2216: fnd_message.set_token (
2217: 'TABLE',
2218: l_lstg_fk_table_long (j)
2219: );
2220: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2216: fnd_message.set_token (
2217: 'TABLE',
2218: l_lstg_fk_table_long (j)
2219: );
2220: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2221: write_to_out (fnd_message.get);
2222: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2223: fnd_message.set_name ('BIS', 'EDW_CDI_NO_LONG_DIM');
2224: fnd_message.set_token (
2217: 'TABLE',
2218: l_lstg_fk_table_long (j)
2219: );
2220: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2221: write_to_out (fnd_message.get);
2222: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2223: fnd_message.set_name ('BIS', 'EDW_CDI_NO_LONG_DIM');
2224: fnd_message.set_token (
2225: 'TABLE',
2219: );
2220: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2221: write_to_out (fnd_message.get);
2222: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2223: fnd_message.set_name ('BIS', 'EDW_CDI_NO_LONG_DIM');
2224: fnd_message.set_token (
2225: 'TABLE',
2226: get_lstg_long_name (g_parent_lstg_fk_table (j))
2227: );
2220: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2221: write_to_out (fnd_message.get);
2222: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2223: fnd_message.set_name ('BIS', 'EDW_CDI_NO_LONG_DIM');
2224: fnd_message.set_token (
2225: 'TABLE',
2226: get_lstg_long_name (g_parent_lstg_fk_table (j))
2227: );
2228: fnd_message.set_token (
2224: fnd_message.set_token (
2225: 'TABLE',
2226: get_lstg_long_name (g_parent_lstg_fk_table (j))
2227: );
2228: fnd_message.set_token (
2229: 'PK',
2230: get_lstg_pk (g_parent_lstg_fk_table (j))
2231: );
2232: write_to_out (fnd_message.get);
2228: fnd_message.set_token (
2229: 'PK',
2230: get_lstg_pk (g_parent_lstg_fk_table (j))
2231: );
2232: write_to_out (fnd_message.get);
2233:
2234: --write_to_out('Parent Table '||get_lstg_long_name(g_parent_lstg_fk_table(j))
2235: --||', Primary Key '||get_lstg_pk(g_parent_lstg_fk_table(j)));
2236: IF g_results_table_flag
2262: END IF;
2263: END IF;
2264: END IF;
2265:
2266: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2267: fnd_message.set_token ('DANGLING', l_num_dang);
2268: fnd_message.set_token ('TOTAL', l_total_recs);
2269: write_to_out (fnd_message.get);
2270: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2263: END IF;
2264: END IF;
2265:
2266: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2267: fnd_message.set_token ('DANGLING', l_num_dang);
2268: fnd_message.set_token ('TOTAL', l_total_recs);
2269: write_to_out (fnd_message.get);
2270: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2271: END IF;
2264: END IF;
2265:
2266: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2267: fnd_message.set_token ('DANGLING', l_num_dang);
2268: fnd_message.set_token ('TOTAL', l_total_recs);
2269: write_to_out (fnd_message.get);
2270: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2271: END IF;
2272:
2265:
2266: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2267: fnd_message.set_token ('DANGLING', l_num_dang);
2268: fnd_message.set_token ('TOTAL', l_total_recs);
2269: write_to_out (fnd_message.get);
2270: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2271: END IF;
2272:
2273: IF l_num_dang > 0 AND g_sample_on
2378:
2379: l_stmt := l_stmt
2380: || ' order by count(1) desc';
2381: write_to_out (' ');
2382: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DANGLING');
2383: write_to_out (fnd_message.get);
2384: --write_to_out('Sample dangling records and their count ');
2385: l_number_dang_str := 1;
2386:
2379: l_stmt := l_stmt
2380: || ' order by count(1) desc';
2381: write_to_out (' ');
2382: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DANGLING');
2383: write_to_out (fnd_message.get);
2384: --write_to_out('Sample dangling records and their count ');
2385: l_number_dang_str := 1;
2386:
2387: IF g_debug
2470: NULL;
2471: END IF;
2472: ELSE --parent is ALL
2473: write_to_out (' ');
2474: fnd_message.set_name (
2475: 'BIS',
2476: 'EDW_CDI_SAMPLE_DANGLING'
2477: );
2478: write_to_out (fnd_message.get);
2474: fnd_message.set_name (
2475: 'BIS',
2476: 'EDW_CDI_SAMPLE_DANGLING'
2477: );
2478: write_to_out (fnd_message.get);
2479: --write_to_out('Sample dangling records and their count ');
2480: write_to_out ( 'ALL('
2481: || l_num_dang
2482: || ')');
2546: l_lstg_fk_table_long (i) := get_lstg_long_name (g_lstg_fk_table (i));
2547: END LOOP;
2548:
2549: write_to_out ('-------------------------------------------------------');
2550: fnd_message.set_name ('BIS', 'EDW_CDI_DANGLING_CHECK_LTC');
2551: write_to_out (fnd_message.get);
2552: --write_to_out('Dangling Records Check against Parent Level Tables');
2553: write_to_out ('-------------------------------------------------------');
2554:
2547: END LOOP;
2548:
2549: write_to_out ('-------------------------------------------------------');
2550: fnd_message.set_name ('BIS', 'EDW_CDI_DANGLING_CHECK_LTC');
2551: write_to_out (fnd_message.get);
2552: --write_to_out('Dangling Records Check against Parent Level Tables');
2553: write_to_out ('-------------------------------------------------------');
2554:
2555: FOR i IN 1 .. g_number_hier_distinct
2555: FOR i IN 1 .. g_number_hier_distinct
2556: LOOP
2557: write_to_out (' ');
2558: write_to_out (' ');
2559: fnd_message.set_name ('BIS', 'EDW_CDI_HIERARCHY');
2560: fnd_message.set_token ('HIER', g_hier_distinct (i));
2561: write_to_out (fnd_message.get);
2562:
2563: --write_to_out('Hierarchy '||g_hier_distinct(i));
2556: LOOP
2557: write_to_out (' ');
2558: write_to_out (' ');
2559: fnd_message.set_name ('BIS', 'EDW_CDI_HIERARCHY');
2560: fnd_message.set_token ('HIER', g_hier_distinct (i));
2561: write_to_out (fnd_message.get);
2562:
2563: --write_to_out('Hierarchy '||g_hier_distinct(i));
2564: FOR j IN 1 .. g_lstg_fk_number
2557: write_to_out (' ');
2558: write_to_out (' ');
2559: fnd_message.set_name ('BIS', 'EDW_CDI_HIERARCHY');
2560: fnd_message.set_token ('HIER', g_hier_distinct (i));
2561: write_to_out (fnd_message.get);
2562:
2563: --write_to_out('Hierarchy '||g_hier_distinct(i));
2564: FOR j IN 1 .. g_lstg_fk_number
2565: LOOP
2672:
2673: IF l_num_dang <= 0
2674: THEN
2675: write_to_out (' ');
2676: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2677: fnd_message.set_token (
2678: 'TABLE',
2679: l_lstg_fk_table_long (j)
2680: );
2673: IF l_num_dang <= 0
2674: THEN
2675: write_to_out (' ');
2676: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2677: fnd_message.set_token (
2678: 'TABLE',
2679: l_lstg_fk_table_long (j)
2680: );
2681: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2677: fnd_message.set_token (
2678: 'TABLE',
2679: l_lstg_fk_table_long (j)
2680: );
2681: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2682: write_to_out (fnd_message.get);
2683: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2684: fnd_message.set_name (
2685: 'BIS',
2678: 'TABLE',
2679: l_lstg_fk_table_long (j)
2680: );
2681: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2682: write_to_out (fnd_message.get);
2683: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2684: fnd_message.set_name (
2685: 'BIS',
2686: 'EDW_CDI_PARENT_TABLE_AND_PK'
2680: );
2681: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2682: write_to_out (fnd_message.get);
2683: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2684: fnd_message.set_name (
2685: 'BIS',
2686: 'EDW_CDI_PARENT_TABLE_AND_PK'
2687: );
2688: fnd_message.set_token (
2684: fnd_message.set_name (
2685: 'BIS',
2686: 'EDW_CDI_PARENT_TABLE_AND_PK'
2687: );
2688: fnd_message.set_token (
2689: 'TABLE',
2690: g_parent_ltc_fk_table_long (j)
2691: );
2692: fnd_message.set_token (
2688: fnd_message.set_token (
2689: 'TABLE',
2690: g_parent_ltc_fk_table_long (j)
2691: );
2692: fnd_message.set_token (
2693: 'PK',
2694: g_parent_ltc_fk_table_pk_long (j)
2695: );
2696: write_to_out (fnd_message.get);
2692: fnd_message.set_token (
2693: 'PK',
2694: g_parent_ltc_fk_table_pk_long (j)
2695: );
2696: write_to_out (fnd_message.get);
2697: --write_to_out('Parent Level Table '||g_parent_ltc_fk_table_long(j)||' with Primary Key '||
2698: --g_parent_ltc_fk_table_pk_long(j));
2699: fnd_message.set_name ('BIS', 'EDW_CDI_NO_RECS_DANGLING');
2700: write_to_out (fnd_message.get);
2695: );
2696: write_to_out (fnd_message.get);
2697: --write_to_out('Parent Level Table '||g_parent_ltc_fk_table_long(j)||' with Primary Key '||
2698: --g_parent_ltc_fk_table_pk_long(j));
2699: fnd_message.set_name ('BIS', 'EDW_CDI_NO_RECS_DANGLING');
2700: write_to_out (fnd_message.get);
2701: --write_to_out(' 0 records are dangling');
2702: ELSE
2703: write_to_out (' ');
2696: write_to_out (fnd_message.get);
2697: --write_to_out('Parent Level Table '||g_parent_ltc_fk_table_long(j)||' with Primary Key '||
2698: --g_parent_ltc_fk_table_pk_long(j));
2699: fnd_message.set_name ('BIS', 'EDW_CDI_NO_RECS_DANGLING');
2700: write_to_out (fnd_message.get);
2701: --write_to_out(' 0 records are dangling');
2702: ELSE
2703: write_to_out (' ');
2704: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2700: write_to_out (fnd_message.get);
2701: --write_to_out(' 0 records are dangling');
2702: ELSE
2703: write_to_out (' ');
2704: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2705: fnd_message.set_token (
2706: 'TABLE',
2707: l_lstg_fk_table_long (j)
2708: );
2701: --write_to_out(' 0 records are dangling');
2702: ELSE
2703: write_to_out (' ');
2704: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_FK');
2705: fnd_message.set_token (
2706: 'TABLE',
2707: l_lstg_fk_table_long (j)
2708: );
2709: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2705: fnd_message.set_token (
2706: 'TABLE',
2707: l_lstg_fk_table_long (j)
2708: );
2709: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2710: write_to_out (fnd_message.get);
2711: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2712: fnd_message.set_name (
2713: 'BIS',
2706: 'TABLE',
2707: l_lstg_fk_table_long (j)
2708: );
2709: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2710: write_to_out (fnd_message.get);
2711: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2712: fnd_message.set_name (
2713: 'BIS',
2714: 'EDW_CDI_PARENT_TABLE_AND_PK'
2708: );
2709: fnd_message.set_token ('FK', g_lstg_fk_long (j));
2710: write_to_out (fnd_message.get);
2711: --write_to_out('Table '||l_lstg_fk_table_long(j)||', Foreign Key '||g_lstg_fk_long(j));
2712: fnd_message.set_name (
2713: 'BIS',
2714: 'EDW_CDI_PARENT_TABLE_AND_PK'
2715: );
2716: fnd_message.set_token (
2712: fnd_message.set_name (
2713: 'BIS',
2714: 'EDW_CDI_PARENT_TABLE_AND_PK'
2715: );
2716: fnd_message.set_token (
2717: 'TABLE',
2718: g_parent_ltc_fk_table_long (j)
2719: );
2720: fnd_message.set_token (
2716: fnd_message.set_token (
2717: 'TABLE',
2718: g_parent_ltc_fk_table_long (j)
2719: );
2720: fnd_message.set_token (
2721: 'PK',
2722: g_parent_ltc_fk_table_pk_long (j)
2723: );
2724: write_to_out (fnd_message.get);
2720: fnd_message.set_token (
2721: 'PK',
2722: g_parent_ltc_fk_table_pk_long (j)
2723: );
2724: write_to_out (fnd_message.get);
2725: --write_to_out('Parent Level Table '||g_parent_ltc_fk_table_long(j)||' with Primary Key '||
2726: --g_parent_ltc_fk_table_pk_long(j));
2727: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2728: fnd_message.set_token ('DANGLING', l_num_dang);
2723: );
2724: write_to_out (fnd_message.get);
2725: --write_to_out('Parent Level Table '||g_parent_ltc_fk_table_long(j)||' with Primary Key '||
2726: --g_parent_ltc_fk_table_pk_long(j));
2727: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2728: fnd_message.set_token ('DANGLING', l_num_dang);
2729: fnd_message.set_token ('TOTAL', l_total_recs);
2730: write_to_out (fnd_message.get);
2731: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2724: write_to_out (fnd_message.get);
2725: --write_to_out('Parent Level Table '||g_parent_ltc_fk_table_long(j)||' with Primary Key '||
2726: --g_parent_ltc_fk_table_pk_long(j));
2727: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2728: fnd_message.set_token ('DANGLING', l_num_dang);
2729: fnd_message.set_token ('TOTAL', l_total_recs);
2730: write_to_out (fnd_message.get);
2731: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2732: END IF;
2725: --write_to_out('Parent Level Table '||g_parent_ltc_fk_table_long(j)||' with Primary Key '||
2726: --g_parent_ltc_fk_table_pk_long(j));
2727: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2728: fnd_message.set_token ('DANGLING', l_num_dang);
2729: fnd_message.set_token ('TOTAL', l_total_recs);
2730: write_to_out (fnd_message.get);
2731: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2732: END IF;
2733:
2726: --g_parent_ltc_fk_table_pk_long(j));
2727: fnd_message.set_name ('BIS', 'EDW_CDI_RECS_DANGLING');
2728: fnd_message.set_token ('DANGLING', l_num_dang);
2729: fnd_message.set_token ('TOTAL', l_total_recs);
2730: write_to_out (fnd_message.get);
2731: --write_to_out(l_num_dang||' records out of '||l_total_recs||' are dangling');
2732: END IF;
2733:
2734: IF g_results_table_flag
2864:
2865: l_stmt := l_stmt
2866: || ' order by count(1) desc';
2867: write_to_out (' ');
2868: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DANGLING');
2869: write_to_out (fnd_message.get);
2870: --write_to_out('Sample dangling records and their count ');
2871: l_number_dang_str := 1;
2872:
2865: l_stmt := l_stmt
2866: || ' order by count(1) desc';
2867: write_to_out (' ');
2868: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DANGLING');
2869: write_to_out (fnd_message.get);
2870: --write_to_out('Sample dangling records and their count ');
2871: l_number_dang_str := 1;
2872:
2873: IF g_debug
3646: g_number_fk_to_check := 0;
3647:
3648: IF get_fk_to_check (p_fk_to_check) = FALSE
3649: THEN
3650: fnd_message.set_name ('BIS', 'EDW_CDI_ERROR_METADATA_READ');
3651: errbuf := fnd_message.get;
3652: write_to_out (errbuf);
3653: retcode := '2';
3654: RETURN;
3647:
3648: IF get_fk_to_check (p_fk_to_check) = FALSE
3649: THEN
3650: fnd_message.set_name ('BIS', 'EDW_CDI_ERROR_METADATA_READ');
3651: errbuf := fnd_message.get;
3652: write_to_out (errbuf);
3653: retcode := '2';
3654: RETURN;
3655: END IF;
3655: END IF;
3656:
3657: IF get_long_names = FALSE
3658: THEN
3659: fnd_message.set_name ('BIS', 'EDW_CDI_NO_FACT_LONG_NAME');
3660: write_to_log_n (
3661: 'Could not get long name for the fact. Stopping Data Check, Time '
3662: || get_time
3663: );
3660: write_to_log_n (
3661: 'Could not get long name for the fact. Stopping Data Check, Time '
3662: || get_time
3663: );
3664: errbuf := fnd_message.get;
3665: write_to_out_n (errbuf);
3666: retcode := '2';
3667: RETURN;
3668: END IF;
3709: BEGIN
3710: write_to_out_log_n (
3711: '--------------------------------------------------'
3712: );
3713: fnd_message.set_name ('BIS', 'EDW_CDI_CHECKING_FACT');
3714: fnd_message.set_token ('FACT', p_fact_name_long);
3715: write_to_out (fnd_message.get);
3716: write_to_log (
3717: ' Checking fact '
3710: write_to_out_log_n (
3711: '--------------------------------------------------'
3712: );
3713: fnd_message.set_name ('BIS', 'EDW_CDI_CHECKING_FACT');
3714: fnd_message.set_token ('FACT', p_fact_name_long);
3715: write_to_out (fnd_message.get);
3716: write_to_log (
3717: ' Checking fact '
3718: || p_fact_name_long
3711: '--------------------------------------------------'
3712: );
3713: fnd_message.set_name ('BIS', 'EDW_CDI_CHECKING_FACT');
3714: fnd_message.set_token ('FACT', p_fact_name_long);
3715: write_to_out (fnd_message.get);
3716: write_to_log (
3717: ' Checking fact '
3718: || p_fact_name_long
3719: || '('
3737: write_to_log_n (
3738: 'Error in getting fstg, dim and key info. cannot check this fact '
3739: || p_fact_name
3740: );
3741: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
3742: write_to_out (fnd_message.get);
3743: --write_to_out('Error in reading metadata for fact. Stopping Data Check');
3744: RETURN FALSE;
3745: END IF;
3738: 'Error in getting fstg, dim and key info. cannot check this fact '
3739: || p_fact_name
3740: );
3741: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
3742: write_to_out (fnd_message.get);
3743: --write_to_out('Error in reading metadata for fact. Stopping Data Check');
3744: RETURN FALSE;
3745: END IF;
3746:
3747: IF generate_fk_table (p_fact_name) = FALSE
3748: THEN
3749: write_to_log_n ( 'Error in generate_fk_table '
3750: || p_fact_name);
3751: fnd_message.set_name ('BIS', 'EDW_CDI_ERROR_GENERATE_TABLE');
3752: write_to_out (fnd_message.get);
3753: --write_to_out('Error in generating fk table. Stopping Data Check');
3754: RETURN FALSE;
3755: END IF;
3748: THEN
3749: write_to_log_n ( 'Error in generate_fk_table '
3750: || p_fact_name);
3751: fnd_message.set_name ('BIS', 'EDW_CDI_ERROR_GENERATE_TABLE');
3752: write_to_out (fnd_message.get);
3753: --write_to_out('Error in generating fk table. Stopping Data Check');
3754: RETURN FALSE;
3755: END IF;
3756:
3768: write_to_log_n (
3769: 'Error in executing fact data check. cannot check this fact '
3770: || p_fact_name
3771: );
3772: fnd_message.set_name ('BIS', 'EDW_CDI_ERROR_FACT_CHECK');
3773: write_to_out (fnd_message.get);
3774: --write_to_out('Error in executing Data Check for fact. Stopping Data Check');
3775: RETURN FALSE;
3776: END IF;
3769: 'Error in executing fact data check. cannot check this fact '
3770: || p_fact_name
3771: );
3772: fnd_message.set_name ('BIS', 'EDW_CDI_ERROR_FACT_CHECK');
3773: write_to_out (fnd_message.get);
3774: --write_to_out('Error in executing Data Check for fact. Stopping Data Check');
3775: RETURN FALSE;
3776: END IF;
3777:
3813:
3814: write_to_out_log_n (
3815: '--------------------------------------------------'
3816: );
3817: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
3818: write_to_out (fnd_message.get);
3819: write_to_log ( ' End Check for fact '
3820: || p_fact_name_long);
3821: write_to_out_log ('--------------------------------------------------');
3814: write_to_out_log_n (
3815: '--------------------------------------------------'
3816: );
3817: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
3818: write_to_out (fnd_message.get);
3819: write_to_log ( ' End Check for fact '
3820: || p_fact_name_long);
3821: write_to_out_log ('--------------------------------------------------');
3822: write_to_out_log (' ');
4281: RETURN FALSE;
4282: END IF;
4283:
4284: write_to_log_n ('Executed execute_fact_total_records');
4285: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
4286: fnd_message.set_token ('TABLE', g_fstg_name);
4287: fnd_message.set_token ('RECORDS', g_fstg_total_records);
4288: write_to_out (fnd_message.get);
4289:
4282: END IF;
4283:
4284: write_to_log_n ('Executed execute_fact_total_records');
4285: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
4286: fnd_message.set_token ('TABLE', g_fstg_name);
4287: fnd_message.set_token ('RECORDS', g_fstg_total_records);
4288: write_to_out (fnd_message.get);
4289:
4290: --write_to_out('Fstg table '||g_fstg_name||' has '||g_fstg_total_records||' total records with collection status of');
4283:
4284: write_to_log_n ('Executed execute_fact_total_records');
4285: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
4286: fnd_message.set_token ('TABLE', g_fstg_name);
4287: fnd_message.set_token ('RECORDS', g_fstg_total_records);
4288: write_to_out (fnd_message.get);
4289:
4290: --write_to_out('Fstg table '||g_fstg_name||' has '||g_fstg_total_records||' total records with collection status of');
4291: --write_to_out('''READY'' ''DANGLING'' or ''DUPLICATE''');
4284: write_to_log_n ('Executed execute_fact_total_records');
4285: fnd_message.set_name ('BIS', 'EDW_CDI_TABLE_AND_RECORDS');
4286: fnd_message.set_token ('TABLE', g_fstg_name);
4287: fnd_message.set_token ('RECORDS', g_fstg_total_records);
4288: write_to_out (fnd_message.get);
4289:
4290: --write_to_out('Fstg table '||g_fstg_name||' has '||g_fstg_total_records||' total records with collection status of');
4291: --write_to_out('''READY'' ''DANGLING'' or ''DUPLICATE''');
4292: IF g_fstg_total_records = 0
4290: --write_to_out('Fstg table '||g_fstg_name||' has '||g_fstg_total_records||' total records with collection status of');
4291: --write_to_out('''READY'' ''DANGLING'' or ''DUPLICATE''');
4292: IF g_fstg_total_records = 0
4293: THEN
4294: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
4295: write_to_out (fnd_message.get);
4296: --write_to_out('No data to check.');
4297: RETURN TRUE;
4298: END IF;
4291: --write_to_out('''READY'' ''DANGLING'' or ''DUPLICATE''');
4292: IF g_fstg_total_records = 0
4293: THEN
4294: fnd_message.set_name ('BIS', 'EDW_CDI_END_DATA_CHECK');
4295: write_to_out (fnd_message.get);
4296: --write_to_out('No data to check.');
4297: RETURN TRUE;
4298: END IF;
4299:
4428: write_to_log_n ( 'going to execute '
4429: || g_fact_dup_stmt_num);
4430: END IF;
4431:
4432: fnd_message.set_name ('BIS', 'EDW_CDI_DUPLICATE_DATA_CHECK');
4433: write_to_out ( '----------'
4434: || fnd_message.get
4435: || '----------');
4436:
4430: END IF;
4431:
4432: fnd_message.set_name ('BIS', 'EDW_CDI_DUPLICATE_DATA_CHECK');
4433: write_to_out ( '----------'
4434: || fnd_message.get
4435: || '----------');
4436:
4437: --write_to_out('----------- Duplicate Check -------------');
4438: write_to_out (' ');
4487: END IF;
4488:
4489: IF l_num_dup <= 0
4490: THEN
4491: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4492: fnd_message.set_token ('TABLE', p_fact_name);
4493: fnd_message.set_token ('DUPLICATE', 0);
4494: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4495: write_to_out (fnd_message.get);
4488:
4489: IF l_num_dup <= 0
4490: THEN
4491: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4492: fnd_message.set_token ('TABLE', p_fact_name);
4493: fnd_message.set_token ('DUPLICATE', 0);
4494: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4495: write_to_out (fnd_message.get);
4496: --write_to_out_log_n('No Duplicate records found');
4489: IF l_num_dup <= 0
4490: THEN
4491: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4492: fnd_message.set_token ('TABLE', p_fact_name);
4493: fnd_message.set_token ('DUPLICATE', 0);
4494: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4495: write_to_out (fnd_message.get);
4496: --write_to_out_log_n('No Duplicate records found');
4497: RETURN TRUE;
4490: THEN
4491: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4492: fnd_message.set_token ('TABLE', p_fact_name);
4493: fnd_message.set_token ('DUPLICATE', 0);
4494: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4495: write_to_out (fnd_message.get);
4496: --write_to_out_log_n('No Duplicate records found');
4497: RETURN TRUE;
4498: END IF;
4491: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4492: fnd_message.set_token ('TABLE', p_fact_name);
4493: fnd_message.set_token ('DUPLICATE', 0);
4494: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4495: write_to_out (fnd_message.get);
4496: --write_to_out_log_n('No Duplicate records found');
4497: RETURN TRUE;
4498: END IF;
4499:
4513:
4514: OPEN cv FOR l_stmt;
4515: FETCH cv INTO l_num_dup;
4516: CLOSE cv;
4517: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4518: fnd_message.set_token ('TABLE', p_fact_name);
4519: fnd_message.set_token ('DUPLICATE', l_num_dup);
4520: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4521: write_to_out (fnd_message.get);
4514: OPEN cv FOR l_stmt;
4515: FETCH cv INTO l_num_dup;
4516: CLOSE cv;
4517: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4518: fnd_message.set_token ('TABLE', p_fact_name);
4519: fnd_message.set_token ('DUPLICATE', l_num_dup);
4520: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4521: write_to_out (fnd_message.get);
4522: write_to_log_n (
4515: FETCH cv INTO l_num_dup;
4516: CLOSE cv;
4517: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4518: fnd_message.set_token ('TABLE', p_fact_name);
4519: fnd_message.set_token ('DUPLICATE', l_num_dup);
4520: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4521: write_to_out (fnd_message.get);
4522: write_to_log_n (
4523: 'Number of duplicate records in interface table '
4516: CLOSE cv;
4517: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4518: fnd_message.set_token ('TABLE', p_fact_name);
4519: fnd_message.set_token ('DUPLICATE', l_num_dup);
4520: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4521: write_to_out (fnd_message.get);
4522: write_to_log_n (
4523: 'Number of duplicate records in interface table '
4524: || l_num_dup
4517: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_DUPLICATE');
4518: fnd_message.set_token ('TABLE', p_fact_name);
4519: fnd_message.set_token ('DUPLICATE', l_num_dup);
4520: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4521: write_to_out (fnd_message.get);
4522: write_to_log_n (
4523: 'Number of duplicate records in interface table '
4524: || l_num_dup
4525: );
4564: END IF;
4565:
4566: l_number_dup_str := 1;
4567: write_to_out (' ');
4568: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DUPLICATE');
4569: write_to_out (fnd_message.get);
4570:
4571: --write_to_out('Sample Duplicate Records and their Count');
4572: IF g_debug
4565:
4566: l_number_dup_str := 1;
4567: write_to_out (' ');
4568: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DUPLICATE');
4569: write_to_out (fnd_message.get);
4570:
4571: --write_to_out('Sample Duplicate Records and their Count');
4572: IF g_debug
4573: THEN
4809: l_dang_instance edw_owb_collection_util.varchartabletype;
4810: l_number_dang_str NUMBER;
4811: l_fk_ok_number NUMBER;
4812: BEGIN
4813: fnd_message.set_name ('BIS', 'EDW_CDI_DANGLING_CHECK');
4814: write_to_out ( '-----------'
4815: || fnd_message.get
4816: || '-----------');
4817:
4811: l_fk_ok_number NUMBER;
4812: BEGIN
4813: fnd_message.set_name ('BIS', 'EDW_CDI_DANGLING_CHECK');
4814: write_to_out ( '-----------'
4815: || fnd_message.get
4816: || '-----------');
4817:
4818: --write_to_out('----------- Dangling Check -------------');
4819: write_to_out (' ');
4942:
4943: IF l_num_dang <= 0
4944: THEN
4945: write_to_out (' ');
4946: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DANGLING_KEYS');
4947: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4948: write_to_out (fnd_message.get);
4949: --write_to_out('No Dangling Records found for Foreign Key '||g_fstg_fk_long(i));
4950: ELSE
4943: IF l_num_dang <= 0
4944: THEN
4945: write_to_out (' ');
4946: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DANGLING_KEYS');
4947: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4948: write_to_out (fnd_message.get);
4949: --write_to_out('No Dangling Records found for Foreign Key '||g_fstg_fk_long(i));
4950: ELSE
4951: write_to_out (' ');
4944: THEN
4945: write_to_out (' ');
4946: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DANGLING_KEYS');
4947: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4948: write_to_out (fnd_message.get);
4949: --write_to_out('No Dangling Records found for Foreign Key '||g_fstg_fk_long(i));
4950: ELSE
4951: write_to_out (' ');
4952: fnd_message.set_name ('BIS', 'EDW_CDI_FACT_DANGLING_KEYS');
4948: write_to_out (fnd_message.get);
4949: --write_to_out('No Dangling Records found for Foreign Key '||g_fstg_fk_long(i));
4950: ELSE
4951: write_to_out (' ');
4952: fnd_message.set_name ('BIS', 'EDW_CDI_FACT_DANGLING_KEYS');
4953: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4954: fnd_message.set_token ('DIM', g_fact_dims_long (i));
4955: fnd_message.set_token ('PK', g_fact_dims_pk_long (i));
4956: fnd_message.set_token ('DANG', l_num_dang);
4949: --write_to_out('No Dangling Records found for Foreign Key '||g_fstg_fk_long(i));
4950: ELSE
4951: write_to_out (' ');
4952: fnd_message.set_name ('BIS', 'EDW_CDI_FACT_DANGLING_KEYS');
4953: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4954: fnd_message.set_token ('DIM', g_fact_dims_long (i));
4955: fnd_message.set_token ('PK', g_fact_dims_pk_long (i));
4956: fnd_message.set_token ('DANG', l_num_dang);
4957: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4950: ELSE
4951: write_to_out (' ');
4952: fnd_message.set_name ('BIS', 'EDW_CDI_FACT_DANGLING_KEYS');
4953: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4954: fnd_message.set_token ('DIM', g_fact_dims_long (i));
4955: fnd_message.set_token ('PK', g_fact_dims_pk_long (i));
4956: fnd_message.set_token ('DANG', l_num_dang);
4957: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4958: write_to_out (fnd_message.get);
4951: write_to_out (' ');
4952: fnd_message.set_name ('BIS', 'EDW_CDI_FACT_DANGLING_KEYS');
4953: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4954: fnd_message.set_token ('DIM', g_fact_dims_long (i));
4955: fnd_message.set_token ('PK', g_fact_dims_pk_long (i));
4956: fnd_message.set_token ('DANG', l_num_dang);
4957: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4958: write_to_out (fnd_message.get);
4959:
4952: fnd_message.set_name ('BIS', 'EDW_CDI_FACT_DANGLING_KEYS');
4953: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4954: fnd_message.set_token ('DIM', g_fact_dims_long (i));
4955: fnd_message.set_token ('PK', g_fact_dims_pk_long (i));
4956: fnd_message.set_token ('DANG', l_num_dang);
4957: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4958: write_to_out (fnd_message.get);
4959:
4960: --write_to_out('For Foreign Key '||g_fstg_fk_long(i));
4953: fnd_message.set_token ('FK', g_fstg_fk_long (i));
4954: fnd_message.set_token ('DIM', g_fact_dims_long (i));
4955: fnd_message.set_token ('PK', g_fact_dims_pk_long (i));
4956: fnd_message.set_token ('DANG', l_num_dang);
4957: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4958: write_to_out (fnd_message.get);
4959:
4960: --write_to_out('For Foreign Key '||g_fstg_fk_long(i));
4961: --write_to_out('Parent Dimension '||g_fact_dims_long(i));
4954: fnd_message.set_token ('DIM', g_fact_dims_long (i));
4955: fnd_message.set_token ('PK', g_fact_dims_pk_long (i));
4956: fnd_message.set_token ('DANG', l_num_dang);
4957: fnd_message.set_token ('TOTAL', g_fstg_total_records);
4958: write_to_out (fnd_message.get);
4959:
4960: --write_to_out('For Foreign Key '||g_fstg_fk_long(i));
4961: --write_to_out('Parent Dimension '||g_fact_dims_long(i));
4962: --write_to_out('Primary Key '||g_fact_dims_pk_long(i));
5078:
5079: OPEN cv FOR l_stmt;
5080: l_number_dang_str := 1;
5081: write_to_out (' ');
5082: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DANGLING');
5083: write_to_out (fnd_message.get);
5084: --write_to_out('Sample Dangling Records and their count ');
5085: l_dang_instance (1) := NULL;
5086:
5079: OPEN cv FOR l_stmt;
5080: l_number_dang_str := 1;
5081: write_to_out (' ');
5082: fnd_message.set_name ('BIS', 'EDW_CDI_SAMPLE_DANGLING');
5083: write_to_out (fnd_message.get);
5084: --write_to_out('Sample Dangling Records and their count ');
5085: l_dang_instance (1) := NULL;
5086:
5087: LOOP
5246: write_to_log_n (get_time);
5247: END IF;
5248:
5249: write_to_out (' ');
5250: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_INTO_FACT');
5251: fnd_message.set_token ('RECORDS', l_number_makeit);
5252: fnd_message.set_token ('TOTAL', g_fstg_total_records);
5253: write_to_out (fnd_message.get);
5254: --write_to_out_n('The total number of records in the fact interface');
5247: END IF;
5248:
5249: write_to_out (' ');
5250: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_INTO_FACT');
5251: fnd_message.set_token ('RECORDS', l_number_makeit);
5252: fnd_message.set_token ('TOTAL', g_fstg_total_records);
5253: write_to_out (fnd_message.get);
5254: --write_to_out_n('The total number of records in the fact interface');
5255: --write_to_out('table that will make it into the WH');
5248:
5249: write_to_out (' ');
5250: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_INTO_FACT');
5251: fnd_message.set_token ('RECORDS', l_number_makeit);
5252: fnd_message.set_token ('TOTAL', g_fstg_total_records);
5253: write_to_out (fnd_message.get);
5254: --write_to_out_n('The total number of records in the fact interface');
5255: --write_to_out('table that will make it into the WH');
5256: --write_to_out(l_number_makeit||' out of '||g_fstg_total_records);
5249: write_to_out (' ');
5250: fnd_message.set_name ('BIS', 'EDW_CDI_RECORDS_INTO_FACT');
5251: fnd_message.set_token ('RECORDS', l_number_makeit);
5252: fnd_message.set_token ('TOTAL', g_fstg_total_records);
5253: write_to_out (fnd_message.get);
5254: --write_to_out_n('The total number of records in the fact interface');
5255: --write_to_out('table that will make it into the WH');
5256: --write_to_out(l_number_makeit||' out of '||g_fstg_total_records);
5257: RETURN TRUE;
5937: THEN
5938: IF l_prev_instance IS NULL
5939: OR l_prev_instance <> l_dang_instances (j)
5940: THEN
5941: fnd_message.set_name ('BIS', 'EDW_CDI_MDR_INSTANCE');
5942: fnd_message.set_token ('INSTANCE', l_instances_name (l_index));
5943: write_to_out_n (fnd_message.get);
5944: write_to_log_n (
5945: 'Missing Date Range for Instance '
5938: IF l_prev_instance IS NULL
5939: OR l_prev_instance <> l_dang_instances (j)
5940: THEN
5941: fnd_message.set_name ('BIS', 'EDW_CDI_MDR_INSTANCE');
5942: fnd_message.set_token ('INSTANCE', l_instances_name (l_index));
5943: write_to_out_n (fnd_message.get);
5944: write_to_log_n (
5945: 'Missing Date Range for Instance '
5946: || l_instances_name (l_index)
5939: OR l_prev_instance <> l_dang_instances (j)
5940: THEN
5941: fnd_message.set_name ('BIS', 'EDW_CDI_MDR_INSTANCE');
5942: fnd_message.set_token ('INSTANCE', l_instances_name (l_index));
5943: write_to_out_n (fnd_message.get);
5944: write_to_log_n (
5945: 'Missing Date Range for Instance '
5946: || l_instances_name (l_index)
5947: || '('
6063:
6064: IF l_view IS NULL
6065: THEN
6066: --write_to_out_n('Dimension '||l_long_name);
6067: fnd_message.set_name ('BIS', 'EDW_CDI_MDR_PK_VIEW_NOT_FOUND');
6068: fnd_message.set_token ('DIM', l_long_name);
6069: fnd_message.set_token ('PK_VIEW', l_view);
6070: write_to_out (fnd_message.get);
6071: --write_to_out('Primary Key View '||l_view||' not found in source database');
6064: IF l_view IS NULL
6065: THEN
6066: --write_to_out_n('Dimension '||l_long_name);
6067: fnd_message.set_name ('BIS', 'EDW_CDI_MDR_PK_VIEW_NOT_FOUND');
6068: fnd_message.set_token ('DIM', l_long_name);
6069: fnd_message.set_token ('PK_VIEW', l_view);
6070: write_to_out (fnd_message.get);
6071: --write_to_out('Primary Key View '||l_view||' not found in source database');
6072: RETURN TRUE;
6065: THEN
6066: --write_to_out_n('Dimension '||l_long_name);
6067: fnd_message.set_name ('BIS', 'EDW_CDI_MDR_PK_VIEW_NOT_FOUND');
6068: fnd_message.set_token ('DIM', l_long_name);
6069: fnd_message.set_token ('PK_VIEW', l_view);
6070: write_to_out (fnd_message.get);
6071: --write_to_out('Primary Key View '||l_view||' not found in source database');
6072: RETURN TRUE;
6073: END IF;
6066: --write_to_out_n('Dimension '||l_long_name);
6067: fnd_message.set_name ('BIS', 'EDW_CDI_MDR_PK_VIEW_NOT_FOUND');
6068: fnd_message.set_token ('DIM', l_long_name);
6069: fnd_message.set_token ('PK_VIEW', l_view);
6070: write_to_out (fnd_message.get);
6071: --write_to_out('Primary Key View '||l_view||' not found in source database');
6072: RETURN TRUE;
6073: END IF;
6074:
6086: THEN
6087: RETURN FALSE;
6088: END IF;
6089:
6090: fnd_message.set_name ('BIS', 'EDW_CDI_DIM_NAME');
6091: fnd_message.set_token ('DIM', l_long_name);
6092: write_to_out_n (fnd_message.get);
6093: write_to_log_n ( 'Dimension '
6094: || l_long_name);
6087: RETURN FALSE;
6088: END IF;
6089:
6090: fnd_message.set_name ('BIS', 'EDW_CDI_DIM_NAME');
6091: fnd_message.set_token ('DIM', l_long_name);
6092: write_to_out_n (fnd_message.get);
6093: write_to_log_n ( 'Dimension '
6094: || l_long_name);
6095:
6088: END IF;
6089:
6090: fnd_message.set_name ('BIS', 'EDW_CDI_DIM_NAME');
6091: fnd_message.set_token ('DIM', l_long_name);
6092: write_to_out_n (fnd_message.get);
6093: write_to_log_n ( 'Dimension '
6094: || l_long_name);
6095:
6096: IF l_min_date IS NOT NULL
6094: || l_long_name);
6095:
6096: IF l_min_date IS NOT NULL
6097: THEN
6098: fnd_message.set_name ('BIS', 'EDW_CDI_DATE_RANGE');
6099: fnd_message.set_token (
6100: 'FROM',
6101: TO_CHAR (l_min_date, 'MM/DD/YYYY HH24:MI:SS')
6102: );
6095:
6096: IF l_min_date IS NOT NULL
6097: THEN
6098: fnd_message.set_name ('BIS', 'EDW_CDI_DATE_RANGE');
6099: fnd_message.set_token (
6100: 'FROM',
6101: TO_CHAR (l_min_date, 'MM/DD/YYYY HH24:MI:SS')
6102: );
6103: fnd_message.set_token (
6099: fnd_message.set_token (
6100: 'FROM',
6101: TO_CHAR (l_min_date, 'MM/DD/YYYY HH24:MI:SS')
6102: );
6103: fnd_message.set_token (
6104: 'TO',
6105: TO_CHAR (l_max_date, 'MM/DD/YYYY HH24:MI:SS')
6106: );
6107: write_to_out (fnd_message.get);
6103: fnd_message.set_token (
6104: 'TO',
6105: TO_CHAR (l_max_date, 'MM/DD/YYYY HH24:MI:SS')
6106: );
6107: write_to_out (fnd_message.get);
6108: write_to_log (
6109: 'From '
6110: || TO_CHAR (l_min_date, 'MM/DD/YYYY HH24:MI:SS')
6111: || ' To '
6111: || ' To '
6112: || TO_CHAR (l_max_date, 'MM/DD/YYYY HH24:MI:SS')
6113: );
6114: ELSE
6115: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DATE_RANGE');
6116: write_to_out (fnd_message.get);
6117: write_to_log (
6118: 'From and To Date could not be determined as no match was found with'
6119: );
6112: || TO_CHAR (l_max_date, 'MM/DD/YYYY HH24:MI:SS')
6113: );
6114: ELSE
6115: fnd_message.set_name ('BIS', 'EDW_CDI_NO_DATE_RANGE');
6116: write_to_out (fnd_message.get);
6117: write_to_log (
6118: 'From and To Date could not be determined as no match was found with'
6119: );
6120: write_to_log ('the source Primary Key View');