DBA Data[Home] [Help]

APPS.FII_PARTY_MKT_CLASS_C dependencies on FII_PARTY_MKT_CLASS

Line 1: PACKAGE BODY fii_party_mkt_class_c AS

1: PACKAGE BODY fii_party_mkt_class_c AS
2: /* $Header: FIIPCLSB.pls 120.11 2006/10/26 19:17:52 mmanasse noship $ */
3:
4: g_bis_setup_exception EXCEPTION;
5: g_user_id NUMBER := fnd_global.user_id;

Line 67: l_setup_ok := BIS_COLLECTION_UTILITIES.setup('FII_PARTY_MKT_CLASS');

63: THEN
64: RAISE l_exception;
65: END IF;
66:
67: l_setup_ok := BIS_COLLECTION_UTILITIES.setup('FII_PARTY_MKT_CLASS');
68: IF (NOT l_setup_ok) THEN
69: errbuf := fnd_message.get;
70: bis_collection_utilities.log( 'BIS Setup Failure ',0);
71: RAISE_APPLICATION_ERROR (-20000, 'Error in SETUP: ' || errbuf);

Line 129: 'FII_PARTY_MKT_CLASS COLLECTION SUCCEEFULL',

125: fnd_date.date_to_displayDT(sysdate),0);
126:
127: BIS_COLLECTION_UTILITIES.wrapup(TRUE,
128: -1,
129: 'FII_PARTY_MKT_CLASS COLLECTION SUCCEEFULL',
130: g_collection_from_date,
131: g_collection_to_date
132: );
133: EXCEPTION

Line 160: p_object_name => 'FII_PARTY_MKT_CLASS',

156: BEGIN
157: g_phase := 'Getting last refresh dates';
158:
159: BIS_COLLECTION_UTILITIES.get_last_refresh_dates(
160: p_object_name => 'FII_PARTY_MKT_CLASS',
161: p_start_date => l_period_from,
162: p_end_date => l_period_to,
163: p_period_from => g_last_collection_from_date,
164: p_period_to => g_last_collection_to_date);

Line 250: -- Load FII_PARTY_MKT_CLASS in initial mode

246: g_errbuf := l_error_message;
247: g_retcode := 2;
248: END non_hierarchical_class;
249:
250: -- Load FII_PARTY_MKT_CLASS in initial mode
251: -- Find the latest class code that was assigned to a party
252: -- If no class code assignment was found for a customer a record with class code '-1' will be
253: -- created for the customer
254: PROCEDURE initial_load IS

Line 297: -- Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table

293: last_updated_by = g_user_id
294: WHERE log_item = 'IND_MAX_BATCH_PARTY_ID';
295: END IF;
296:
297: -- Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table
298: g_phase := 'Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table';
299:
300: bis_collection_utilities.log('Truncating FII_PARTY_MKT_CLASS Table ');
301:

Line 298: g_phase := 'Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table';

294: WHERE log_item = 'IND_MAX_BATCH_PARTY_ID';
295: END IF;
296:
297: -- Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table
298: g_phase := 'Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table';
299:
300: bis_collection_utilities.log('Truncating FII_PARTY_MKT_CLASS Table ');
301:
302: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS';

Line 300: bis_collection_utilities.log('Truncating FII_PARTY_MKT_CLASS Table ');

296:
297: -- Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table
298: g_phase := 'Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table';
299:
300: bis_collection_utilities.log('Truncating FII_PARTY_MKT_CLASS Table ');
301:
302: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS';
303: EXECUTE IMMEDIATE l_sql_string;
304:

Line 302: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS';

298: g_phase := 'Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table';
299:
300: bis_collection_utilities.log('Truncating FII_PARTY_MKT_CLASS Table ');
301:
302: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS';
303: EXECUTE IMMEDIATE l_sql_string;
304:
305: bis_collection_utilities.log('Bis log file was reset for FII_PARTY_MKT_CLASS. ');
306: BIS_COLLECTION_UTILITIES.DeleteLogForObject('FII_PARTY_MKT_CLASS');

Line 305: bis_collection_utilities.log('Bis log file was reset for FII_PARTY_MKT_CLASS. ');

301:
302: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS';
303: EXECUTE IMMEDIATE l_sql_string;
304:
305: bis_collection_utilities.log('Bis log file was reset for FII_PARTY_MKT_CLASS. ');
306: BIS_COLLECTION_UTILITIES.DeleteLogForObject('FII_PARTY_MKT_CLASS');
307:
308: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table');
309: g_phase := 'Populating FII_PARTY_MKT_CLASS table';

Line 306: BIS_COLLECTION_UTILITIES.DeleteLogForObject('FII_PARTY_MKT_CLASS');

302: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS';
303: EXECUTE IMMEDIATE l_sql_string;
304:
305: bis_collection_utilities.log('Bis log file was reset for FII_PARTY_MKT_CLASS. ');
306: BIS_COLLECTION_UTILITIES.DeleteLogForObject('FII_PARTY_MKT_CLASS');
307:
308: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table');
309: g_phase := 'Populating FII_PARTY_MKT_CLASS table';
310:

Line 308: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table');

304:
305: bis_collection_utilities.log('Bis log file was reset for FII_PARTY_MKT_CLASS. ');
306: BIS_COLLECTION_UTILITIES.DeleteLogForObject('FII_PARTY_MKT_CLASS');
307:
308: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table');
309: g_phase := 'Populating FII_PARTY_MKT_CLASS table';
310:
311: INSERT /*+ APPEND */ INTO fii_party_mkt_class
312: (

Line 309: g_phase := 'Populating FII_PARTY_MKT_CLASS table';

305: bis_collection_utilities.log('Bis log file was reset for FII_PARTY_MKT_CLASS. ');
306: BIS_COLLECTION_UTILITIES.DeleteLogForObject('FII_PARTY_MKT_CLASS');
307:
308: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table');
309: g_phase := 'Populating FII_PARTY_MKT_CLASS table';
310:
311: INSERT /*+ APPEND */ INTO fii_party_mkt_class
312: (
313: party_id,

Line 311: INSERT /*+ APPEND */ INTO fii_party_mkt_class

307:
308: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table');
309: g_phase := 'Populating FII_PARTY_MKT_CLASS table';
310:
311: INSERT /*+ APPEND */ INTO fii_party_mkt_class
312: (
313: party_id,
314: class_category,
315: class_code,

Line 349: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into fii_party_mkt_class');

345: ORDER BY owner_table_id
346: )
347: GROUP BY party_id, class_category;
348:
349: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into fii_party_mkt_class');
350:
351: commit; --Added for ORA-12838: cannot read/modify an object after modifying it in parallel
352:
353: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table for unassigned customers');

Line 353: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table for unassigned customers');

349: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into fii_party_mkt_class');
350:
351: commit; --Added for ORA-12838: cannot read/modify an object after modifying it in parallel
352:
353: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table for unassigned customers');
354:
355: g_phase := 'Populating FII_PARTY_MKT_CLASS table for unassigned customers';
356:
357: INSERT /*+ APPEND */ INTO fii_party_mkt_class

Line 355: g_phase := 'Populating FII_PARTY_MKT_CLASS table for unassigned customers';

351: commit; --Added for ORA-12838: cannot read/modify an object after modifying it in parallel
352:
353: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table for unassigned customers');
354:
355: g_phase := 'Populating FII_PARTY_MKT_CLASS table for unassigned customers';
356:
357: INSERT /*+ APPEND */ INTO fii_party_mkt_class
358: (
359: party_id,

Line 357: INSERT /*+ APPEND */ INTO fii_party_mkt_class

353: bis_collection_utilities.log('Populating FII_PARTY_MKT_CLASS table for unassigned customers');
354:
355: g_phase := 'Populating FII_PARTY_MKT_CLASS table for unassigned customers';
356:
357: INSERT /*+ APPEND */ INTO fii_party_mkt_class
358: (
359: party_id,
360: class_category,
361: class_code,

Line 382: WHERE party_id NOT IN (SELECT /*+ PARALLEL(FII_PARTY_MKT_CLASS) */

378: FROM
379: ( SELECT /*+ PARALLEL(HZ_CUST_ACCOUNTS) */
380: DISTINCT party_id
381: FROM hz_cust_accounts
382: WHERE party_id NOT IN (SELECT /*+ PARALLEL(FII_PARTY_MKT_CLASS) */
383: party_id
384: FROM fii_party_mkt_class
385: WHERE class_category = g_class_type
386: )

Line 384: FROM fii_party_mkt_class

380: DISTINCT party_id
381: FROM hz_cust_accounts
382: WHERE party_id NOT IN (SELECT /*+ PARALLEL(FII_PARTY_MKT_CLASS) */
383: party_id
384: FROM fii_party_mkt_class
385: WHERE class_category = g_class_type
386: )
387: );
388:

Line 389: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into fii_party_mkt_class');

385: WHERE class_category = g_class_type
386: )
387: );
388:
389: FII_UTIL.Write_Log('Inserted ' || SQL%ROWCOUNT || ' rows into fii_party_mkt_class');
390:
391: EXCEPTION
392: WHEN OTHERS THEN
393: l_error_message := sqlerrm;

Line 401: -- Load FII_PARTY_MKT_CLASS in incremental mode

397: g_errbuf := l_error_message;
398: g_retcode := 2;
399: END initial_load;
400:
401: -- Load FII_PARTY_MKT_CLASS in incremental mode
402: PROCEDURE incremental_load IS
403: l_sql_string VARCHAR2(1000);
404: l_fii_schema VARCHAR2(100);
405: l_error_message VARCHAR2(4000);

Line 425: Delete from fii_party_mkt_class

421:
422: g_phase := 'Deleting merged parties';
423: FII_UTIL.Write_Log (g_phase);
424:
425: Delete from fii_party_mkt_class
426: where party_id in
427: (select from_entity_id
428: from hz_merge_party_history m,
429: hz_merge_dictionary d

Line 468: -- Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table

464: last_updated_by = g_user_id
465: WHERE log_item = 'IND_MAX_BATCH_PARTY_ID';
466: END IF;
467:
468: -- Identify Last valid class code for each party and create a record in FII_PARTY_MKT_CLASS table
469:
470:
471: bis_collection_utilities.log('Truncating Staging table');
472:

Line 473: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS_STG';

469:
470:
471: bis_collection_utilities.log('Truncating Staging table');
472:
473: l_sql_string := 'TRUNCATE TABLE ' || l_fii_schema ||'.FII_PARTY_MKT_CLASS_STG';
474: EXECUTE IMMEDIATE l_sql_string;
475:
476: bis_collection_utilities.log('Populating Staging table with incremental records from hz_code_assignments table');
477: g_phase := 'Populating Staging table with incremental records from hz_code_assignments table';

Line 480: INSERT INTO fii_party_mkt_class_stg

476: bis_collection_utilities.log('Populating Staging table with incremental records from hz_code_assignments table');
477: g_phase := 'Populating Staging table with incremental records from hz_code_assignments table';
478:
479: -- Bug 5093260. Performance enhancement
480: INSERT INTO fii_party_mkt_class_stg
481: (
482: owner_table_id,
483: class_category,
484: class_code,

Line 533: INSERT INTO fii_party_mkt_class_stg

529: FROM v$parameter
530: WHERE name = 'nls_date_format';
531:
532:
533: INSERT INTO fii_party_mkt_class_stg
534: (
535: owner_table_id,
536: class_category,
537: class_code,

Line 565: FROM FII_PARTY_MKT_CLASS_STG s

561: FROM HZ_CUST_ACCOUNTS a
562: WHERE CREATION_DATE BETWEEN g_collection_from_date AND g_collection_to_date
563: AND PARTY_ID NOT IN (
564: SELECT /*+ parallel(s) */ OWNER_TABLE_ID
565: FROM FII_PARTY_MKT_CLASS_STG s
566: WHERE CLASS_CATEGORY = g_class_type
567: )
568: );
569:

Line 570: g_phase := 'gather_table_stats for FII_PARTY_MKT_CLASS_STG';

566: WHERE CLASS_CATEGORY = g_class_type
567: )
568: );
569:
570: g_phase := 'gather_table_stats for FII_PARTY_MKT_CLASS_STG';
571: FND_STATS.gather_table_stats
572: (ownname => l_fii_schema,
573: tabname => 'FII_PARTY_MKT_CLASS_STG');
574:

Line 573: tabname => 'FII_PARTY_MKT_CLASS_STG');

569:
570: g_phase := 'gather_table_stats for FII_PARTY_MKT_CLASS_STG';
571: FND_STATS.gather_table_stats
572: (ownname => l_fii_schema,
573: tabname => 'FII_PARTY_MKT_CLASS_STG');
574:
575: bis_collection_utilities.log('Merging records into FII_PARTY_MKT_CLASS table ');
576: g_phase := 'Merging records into FII_PARTY_MKT_CLASS table';
577:

Line 575: bis_collection_utilities.log('Merging records into FII_PARTY_MKT_CLASS table ');

571: FND_STATS.gather_table_stats
572: (ownname => l_fii_schema,
573: tabname => 'FII_PARTY_MKT_CLASS_STG');
574:
575: bis_collection_utilities.log('Merging records into FII_PARTY_MKT_CLASS table ');
576: g_phase := 'Merging records into FII_PARTY_MKT_CLASS table';
577:
578: MERGE INTO fii_party_mkt_class cl
579: USING

Line 576: g_phase := 'Merging records into FII_PARTY_MKT_CLASS table';

572: (ownname => l_fii_schema,
573: tabname => 'FII_PARTY_MKT_CLASS_STG');
574:
575: bis_collection_utilities.log('Merging records into FII_PARTY_MKT_CLASS table ');
576: g_phase := 'Merging records into FII_PARTY_MKT_CLASS table';
577:
578: MERGE INTO fii_party_mkt_class cl
579: USING
580: (

Line 578: MERGE INTO fii_party_mkt_class cl

574:
575: bis_collection_utilities.log('Merging records into FII_PARTY_MKT_CLASS table ');
576: g_phase := 'Merging records into FII_PARTY_MKT_CLASS table';
577:
578: MERGE INTO fii_party_mkt_class cl
579: USING
580: (
581: SELECT
582: party_id,

Line 600: FROM FII_PARTY_MKT_CLASS_STG

596: creation_date,
597: last_update_date,
598: CASE WHEN primary_flag = 'Y'
599: THEN 2 ELSE 1 END active_priority
600: FROM FII_PARTY_MKT_CLASS_STG
601: WHERE g_collection_to_date BETWEEN start_date AND nvl(end_date, g_collection_to_date+1)
602: ORDER BY owner_table_id
603: )
604: GROUP BY party_id, class_category

Line 665: -- 3. table fii_party_mkt_class is empty: INIT

661: ----------------------------------------------------------------------------
662: -- Run incremental/initial load based on the following:
663: -- 1. Last run was successful or not: Yes INCRE and No INIT
664: -- 2. Global parameter has been changed or not: Yes INIT and No INCRE
665: -- 3. table fii_party_mkt_class is empty: INIT
666: ----------------------------------------------------------------------------
667:
668: -- If the table is empty then run Initial load
669: select count(*) into l_count

Line 670: from fii_party_mkt_class;

666: ----------------------------------------------------------------------------
667:
668: -- If the table is empty then run Initial load
669: select count(*) into l_count
670: from fii_party_mkt_class;
671:
672: IF (l_count = 0) THEN
673: return 'INIT';
674: ELSE

Line 677: from fii_party_mkt_class

673: return 'INIT';
674: ELSE
675: -- If the global parameter has changed then run initial load
676: select class_category into l_class_category
677: from fii_party_mkt_class
678: where rownum <2;
679:
680: IF l_class_category <> nvl(bis_common_parameters.GET_BIS_CUST_CLASS_TYPE, -1) THEN
681: return 'INIT';

Line 685: p_object_name => 'FII_PARTY_MKT_CLASS',

681: return 'INIT';
682: ELSE
683: -- If the last run was unsuccessfull run initial else incremental
684: BIS_COLLECTION_UTILITIES.get_last_refresh_dates(
685: p_object_name => 'FII_PARTY_MKT_CLASS',
686: p_start_date => l_period_from,
687: p_end_date => l_period_to,
688: p_period_from => g_last_collection_from_date,
689: p_period_to => g_last_collection_to_date);

Line 711: END fii_party_mkt_class_c;

707: END IF;
708:
709: end DEFAULT_LOAD_MODE;
710:
711: END fii_party_mkt_class_c;