DBA Data[Home] [Help]

APPS.BIC_LIFECYCLE_EXTRACT_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 5

  g_last_updated_by          NUMBER;
Line: 7

  g_last_update_login        NUMBER;
Line: 33

FUNCTION Common_Select RETURN VARCHAR2 ;
Line: 35

PROCEDURE Insert_New_Cust ;
Line: 36

PROCEDURE Insert_Insig_Cust(p_select VARCHAR2) ;
Line: 42

PROCEDURE Insert_Record (p_org_id       NUMBER,
                         p_measure_id   NUMBER,
                         p_start_date   DATE,
                         p_cust_id      NUMBER,
                         p_value        NUMBER) ;
Line: 48

PROCEDURE Insert_Others(p_select      VARCHAR2) ;
Line: 79

    p_delete_flag  varchar2,
    p_org_id       NUMBER
    )  IS
 x_c_select        VARCHAR2(2000) ;
Line: 95

  IF p_delete_flag = 'N' THEN
    bic_summary_extract_pkg.extract_periods (
  				add_months(p_start_date ,g_lc_new_cust_period*- 1),
				p_end_date,
				'LIFE_CYCLE',
				'N',
				p_delete_flag,
				p_org_id);
Line: 109

  SELECT count(*) INTO rec_count
  FROM	 bic_temp_periods;
Line: 149

  write_log('Before Inserting New Customers for Life Cycle ....',
			  'bic_lifecycle_extract_pkg.extract_lifecycle_data');
Line: 151

  IF p_delete_flag = 'N' THEN
    bic_summary_extract_pkg.extract_periods (
  				add_months(p_start_date ,g_lc_new_cust_period*- 1),
				p_end_date,
				'LIFE_CYCLE',
				'N',
				p_delete_flag,
				p_org_id);
Line: 164

    x_c_select := Common_Select ;
Line: 166

    Insert_New_Cust ;
Line: 167

    write_log('Before Inserting Insignificant Customers for Life Cycle ....',
			'bic_lifecycle_extract_pkg.extract_lifecycle_data');
Line: 169

    insert_Insig_Cust(x_c_select) ;
Line: 170

    write_log('Before Inserting Stable, Defected, Growing and Declining
			 Customers for Life Cycle ....',
               'bic_lifecycle_extract_pkg.extract_lifecycle_data');
Line: 173

    Insert_Others(x_c_select) ;
Line: 207

PROCEDURE Insert_New_Cust IS

  CURSOR party_cur IS
    SELECT party_id, MIN(NVL(account_established_date,creation_date))
	 FROM hz_cust_accounts
     GROUP BY party_id
	HAVING MIN(NVL(account_established_date,creation_date)) >=
		   ADD_MONTHS(g_lc_st_month,g_lc_new_cust_period*-1 +1 );
Line: 218

    bic_summary_extract_pkg.debug(' entered Insert_New_Cust + : ');
Line: 225

    INSERT INTO bic_party_summary (
       measure_code
      ,measure_id
      ,party_id --,customer_id
      ,period_start_date
      ,VALUE
      ,bucket_id
      ,last_update_date
      ,last_updated_by
      ,creation_date
      ,created_by
      ,last_update_login
      ,request_id
      ,program_application_id
      ,program_id
      ,program_update_date
      ,score)
    SELECT
	 'LIFE_CYCLE'
      ,g_lc_measure_id
      ,x_party_id
      ,bdt.act_period_start_date
      ,1
      ,NULL
      ,SYSDATE
      ,g_last_updated_by
      ,SYSDATE
      ,g_created_by
      ,g_last_update_login
      ,g_request_id
      ,g_program_application_id
      ,g_program_id
      ,SYSDATE
      ,NULL
    FROM
       bic_temp_periods          bdt
    WHERE
       bdt.start_date BETWEEN g_lc_st_month AND g_lc_end_month
    AND x_account_established_date BETWEEN
		  ADD_MONTHS(bdt.act_period_end_date,g_lc_new_cust_period *-1)+1
	    AND bdt.act_period_end_date ;
Line: 270

   bic_summary_extract_pkg.debug(' exited Insert_New_Cust + : ');
Line: 280

	   write_log('Error:' || sqlerrm, 'bic_lifecycle_extract_pkg.Insert_New_Cust') ; */
Line: 282

END Insert_New_Cust ;
Line: 286

FUNCTION Common_Select  RETURN VARCHAR2 IS
 x_n1  NUMBER ;
Line: 306

   x_s1  := 'SELECT start_date, customer_id , sum(p1_value) value_p1, sum(p2_value) value_p2
FROM (' ;
Line: 309

   x_sc1 := 'SELECT start_date, customer_id , ' ;
Line: 331

END Common_Select ;
Line: 380

PROCEDURE Insert_Insig_Cust(p_select VARCHAR2) IS

 x_s    VARCHAR2(40) ;
Line: 394

     bic_summary_extract_pkg.debug(' entered Insert_Insig_Cust + : ');
Line: 395

  x_s1 := 'SELECT start_date, customer_id  FROM (' ;
Line: 404

  OPEN x_cust_cur FOR x_s1 || p_select || x_s  ;
Line: 417

    Insert_Record (NULL, g_lc_measure_id, x_start_date(i), x_cust_id(i), 6) ;
Line: 421

     bic_summary_extract_pkg.debug(' exited Insert_Insig_Cust + : ');
Line: 426

	 write_log('Error:' || sqlerrm || 'for party ' || x_cust_id(i), 'bic_lifecycle_extract_pkg.Insert_Insig_Cust');
Line: 430

END Insert_Insig_Cust ;
Line: 434

PROCEDURE Insert_Others(p_select      VARCHAR2) IS
 x_s      VARCHAR2(40) ;
Line: 453

     bic_summary_extract_pkg.debug(' entered Insert_Others + : ');
Line: 455

  x_s1 := 'SELECT start_date, customer_id, value_p1, value_p2  FROM (' ;
Line: 465

  OPEN x_cur FOR x_s1 || p_select || x_s ;
Line: 490

      Insert_Record (NULL, g_lc_measure_id, x_start_date(i), x_cust_id(i), x_value) ;
Line: 496

     bic_summary_extract_pkg.debug(' exited Insert_Others + : ');
Line: 503

	   write_log('Error:' || sqlerrm || ' for party ' || x_cust_id(i), 'bic_lifecycle_extract_pkg.Insert_Others'); */
Line: 506

END Insert_Others ;
Line: 510

PROCEDURE Insert_Record (p_org_id       NUMBER,
                         p_measure_id   NUMBER,
                         p_start_date   DATE,
                         p_cust_id      NUMBER,
                         p_value        NUMBER) IS
 BEGIN


     INSERT INTO bic_party_summary
            (measure_code,   measure_id,             period_start_date,      VALUE,
             party_id,       last_update_date,       last_updated_by,
             creation_date,  created_by,             last_update_login,
             request_id,     program_application_id, program_id,
             program_update_date)
     VALUES ('LIFE_CYCLE',  p_measure_id,   p_start_date,             p_value,
             p_cust_id,     SYSDATE,        g_last_updated_by,
             SYSDATE,       g_created_by,   g_last_update_login,
             g_request_id,  g_program_application_id,   g_program_id,
             SYSDATE) ;
Line: 532

        write_log('LifeCycle Step-up resulted: Error inside insert_record :' || SQLERRM || ' for customer ' || p_cust_id ||
        ' period ' || p_start_date, 'bic_lifecycle_extract_pkg.Insert_Record');
Line: 539

	--   write_log('Error:' || sqlerrm, 'bic_lifecycle_extract_pkg.Insert_Record');
Line: 542

END Insert_Record ;
Line: 592

  g_last_updated_by        := fnd_global.user_id        ;
Line: 594

  g_last_update_login      := fnd_global.login_id       ;
Line: 600

   SELECT  measure_value1, measure_value2, measure_value1_op, measure_value2_op
   INTO    g_growing_vlu1, g_growing_vlu2, g_op_growing1, g_op_growing2
   FROM    bic_lc_setup_all
   WHERE   stage_code = 'GROWING';
Line: 607

   SELECT  measure_value1, measure_value2, measure_value1_op, measure_value2_op
   INTO    g_defected_vlu1, g_defected_vlu2, g_op_defected1, g_op_defected2
   FROM    bic_lc_setup_all
   WHERE   stage_code = 'DEFECTED';
Line: 620

   SELECT  measure_value1, measure_value2, measure_value1_op, measure_value2_op
   INTO    g_declining_vlu1, g_declining_vlu2, g_op_declining1, g_op_declining2
   FROM    bic_lc_setup_all
   WHERE   stage_code = 'DECLINING';
Line: 628

   SELECT  lc_comparison_type,    lc_measure_code,
           lc_granularity_level,  lc_starting_period,
           lc_new_cust_period,    lc_insig_level
   INTO     g_lc_comparison_type,  g_measure_for_lc_stage,
            g_lc_granularity_level,g_lc_starting_period,
            g_lc_new_cust_period,  g_lc_insig_level
   FROM   bic_profile_values_all
   WHERE  org_id IS NULL ;
Line: 639

   SELECT measure_id INTO g_lc_measure_id
   FROM   bic_measures_all
   WHERE  measure_code = 'LIFE_CYCLE' AND org_id IS NULL ;