DBA Data[Home] [Help]

APPS.IEX_SCORE_NEW_PVT SQL Statements

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

Line: 28

||             p_col_name name of colum you wish to select on
||             p_table_name name of table to select from
||
|| Return value:  True =OK; Falso=Error
Line: 64

             ' Select Select_ID, From_table ' ||
             ' From jtf_objects_b ' ||
             ' where object_code = :p_object_code'
             into l_col_name, l_table_name
             using p_object_type;
Line: 121

        ' Select jtf_object_code ' ||
        ' From iex_scores ' ||
        ' where score_id = :p_score_id'
        into l_object_type
        using p_score_id;
Line: 267

 * out_of_range_rule for a given score engine, and update the
 * global variables: G_MIN_SCORE, G_MAX_SCORE, G_RULE.
 *
 * Parameter: P_SCORE_ID   Scoring_Engine
 * Major Modifications:
 *      when            who                       what
 *     10/18/04        clchang                  created
 ******/
 PROCEDURE getScoreRange(P_SCORE_ID       IN NUMBER )
 IS

    CURSOR c_chk_range(p_score_id NUMBER) IS
       SELECT NVL(WEIGHT_REQUIRED, 'N'),
              NVL(SCORE_RANGE_LOW, IEX_SCORE_NEW_PVT.G_MIN_SCORE),
              NVL(SCORE_RANGE_HIGH, IEX_SCORE_NEW_PVT.G_MAX_SCORE),
              NVL(OUT_OF_RANGE_RULE, IEX_SCORE_NEW_PVT.G_RULE)
         FROM IEX_SCORES
        WHERE SCORE_ID = p_score_id;
Line: 354

|| Return value: select statement for the Universe
||
|| Source Tables: IEX_SCORES, IEX_SCORE_COMPONENTS, IEX_SCORE_COMP_TYPES_B/TL
||
|| Target Tables: none
||
|| Creation date:  01/14/02 1:55:PM
||
|| Major Modifications: when            who                       what
||                      01/14/02        raverma             created
||                      03/12/02        raverma             added function_flag to return tbl
||   10/18/04        clchang      updated this procedure for scoring engine enhancement
||                                in 11.5.11.
||                                1. new column METRIC_FLAG in iex_score_components
*/
PROCEDURE getComponents(P_SCORE_ID       IN NUMBER,
                        X_SCORE_COMP_TBL OUT NOCOPY IEX_SCORE_NEW_PVT.SCORE_ENG_COMP_TBL)
IS

    -- clchang updated the cursor 10/18/04 with metric_flag;
Line: 377

        SELECT
            SCORE_COMPONENT_ID,
            SCORE_COMP_WEIGHT,
            SCORE_COMP_VALUE,
            NVL(FUNCTION_FLAG, 'N') FUNCTION_FLAG
        FROM
            IEX_SCORE_ENG_COMPONENTS_V
        WHERE SCORE_ID = p_score_id
          AND NVL(METRIC_FLAG, 'N') = 'N'
	  order by score_component_id;
Line: 458

||   10/18/04        clchang      updated this procedure for scoring engine enhancement
||                                in 11.5.11.
||                                1. new column METRIC_FLAG in iex_score_components
||                                2. new columns 'WEIGHT_REQUIRED, SCORE_RANGE_LOW,
||                                   SCORE_RANGE_HIGH, OUT_OF_RANGE_RULE' in iex_scores
||                                3. no 1-100 score limitation;
Line: 503

    l_execute_style       VARCHAR2(1);  -- are we using select or function call
Line: 552

    Select NVL(CONCURRENT_PROG_NAME, 'X')
    Into l_conc_prog_name
    From IEX_SCORES scr, IEX_SCORE_COMPONENTS scomp
    Where scomp.score_component_id = p_score_comp_tbl(1).SCORE_COMPONENT_ID
      AND scr.Score_ID = scomp.score_id;
Line: 581

		  select score.jtf_object_code
		  into l_jtf_obj_code
		  from iex_scores score
		  where score_id=p_score_comp_tbl(1).score_id;
Line: 591

		       select party_name
		       into l_object_name
		       from hz_parties
		       where party_id=t_object_ids(l_count);
Line: 597

		       select account_number
		       into l_object_name
		       from hz_cust_accounts
		       where cust_account_id=t_object_ids(l_count);
Line: 603

		       select hcsua.location,hca.account_number
		       into l_object_name,l_acct_number
		       from hz_cust_site_uses_all hcsua,hz_cust_acct_sites_all hcasa, hz_cust_accounts hca
		       where hcsua.cust_acct_site_id=hcasa.cust_acct_site_id
		       and hcasa.cust_account_id=hca.cust_account_id
		       and hcsua.site_use_code='BILL_TO'
		       and hcsua.site_use_id=t_object_ids(l_count);
Line: 612

		       select aps.trx_number,hca.account_number
		       into l_object_name,l_acct_number
		       from ar_payment_schedules_all aps,hz_cust_accounts hca
		       where aps.customer_id=hca.cust_account_id
		       and aps.payment_schedule_id=t_object_ids(l_count)
		       and aps.payment_schedule_id>0;
Line: 890

		select jtf_object_code into t_object_code
                from iex_scores
                where score_id = l_score_comp_tbl(1).SCORE_ID;
Line: 913

		l_objects_tbl.delete;
Line: 914

		l_new_scores_tbl.delete;
Line: 915

		l_scores_tbl.delete;
Line: 934

		select jtf_object_code into t_object_code
                from iex_scores
                where score_id = l_score_comp_tbl(1).SCORE_ID;
Line: 960

    l_scores_tbl.delete;
Line: 1102

      /*select score_name
      into l_score_name
      from iex_scores
      where score_id=p_score_id;
Line: 1111

      select jtf_object_code into l_object_type
      from iex_scores
      where score_id = p_score_id;*/
Line: 1116

      SELECT score.score_name,
	  score.jtf_object_code,
	  obj.object_filter_name,
	  obj.entity_name,
	  score.concurrent_prog_name,
	  score.status_determination,
	  score.score_range_low,
	  score.score_range_high
	  into l_score_name,l_object_code,l_obj_filter_name,l_obj_filter_view,
	        l_cp_name,l_sts_det,l_score_low,l_score_high
	FROM iex_scores score,
	  iex_object_filters obj
	WHERE score.score_id        =obj.object_id
	AND obj.object_filter_type='IEXSCORE'
	and score.score_id=p_score_id;
Line: 1132

     SELECT NAME
     into l_object_type
     FROM jtf_objects_vl
     where object_code=l_object_code;
Line: 1191

	  SELECT sc_typ_tl.score_comp_name,
		  sc_typ.function_flag,
		  sc.score_comp_weight,
		  sc_typ.score_comp_value
		  into l_score_comp_name,l_function_flg,l_score_comp_wgt,l_score_comp_val
		FROM iex_score_components sc,
		  iex_score_comp_types_tl sc_typ_tl,
		  iex_score_comp_types_b sc_typ
		WHERE sc.score_comp_type_id  = sc_typ.score_comp_type_id
		AND sc_typ.score_comp_type_id= sc_typ_tl.score_comp_type_id
		AND sc_typ_tl.language       ='US'
		AND sc.score_component_id=l_components_tbl(comp).score_component_id;
Line: 1219

        select count(*)
	 into l_cnt
	 from iex_score_comp_det
	 where score_component_id=l_components_tbl(comp).score_component_id;
Line: 1225

	      select range_low,range_high,new_value
	     bulk collect into l_sc_range_low,l_sc_range_high,l_sc_val
	     from iex_score_comp_det sc_det
	    where score_component_id=l_components_tbl(comp).score_component_id;
Line: 1255

            Select IEX_DEL_WF_S.NEXTVAL INTO l_del_buff_bridge FROM Dual;  --Added by schekuri for bug#6373998 on 31-Aug-2007
Line: 1306

		 l_universe.delete;
Line: 1388

          Select NVL(cp.Concurrent_Program_Name, 'X')
            Into l_conc_prog_name
            From IEX_SCORES scr, fnd_concurrent_programs cp
            Where scr.concurrent_prog_name = cp.concurrent_program_name AND
                 scr.Score_ID = p_score_id;
Line: 1724

    select TO_CHAR(sysdate,'YYYY-MM-DD')
    into l_sysdate
    from dual;
Line: 1729

       select security_profile_name into l_pf_name from per_security_profiles
         where security_profile_id = l_pf_value;
Line: 1746

		  select name
		  into l_org_id
		  from hr_operating_units
		  where organization_id=p_org_id;
Line: 1769

      select score_name into l_score_name1 from iex_scores where score_id=p_score_id1;
Line: 1775

      select score_name into l_score_name2 from iex_scores where score_id=p_score_id2;
Line: 1781

      select score_name into l_score_name3 from iex_scores where score_id=p_score_id3;
Line: 1787

      select score_name into l_score_name4 from iex_scores where score_id=p_score_id4;
Line: 1793

      select score_name into l_score_name5 from iex_scores where score_id=p_score_id5;
Line: 1939

|| Overview:    delete rows from IEX_SCORE_HISTORIES to improve performance
||
|| Parameter:   p_score_object_code => score_object_code to erase
||              p_from_date         => remove from this date
||              p_to_Date           => remove up to this date
||              p_request_id        => remove this request
||              p_save_last_run     => save the last run of the object type
||              all parameters are AND logic on the where clause
||
|| Source Tables:
||
|| Target Tables:  IEX_SCORE_HISTORIES
||
|| Creation date:  01/28/03 3:14:PM
||
|| Major Modifications: when            who                       what
||                      01/28/03        raverma                created
*/
Procedure eraseScores(ERRBUF              OUT NOCOPY VARCHAR2,
                      RETCODE             OUT NOCOPY VARCHAR2,
		      p_org_id            IN NUMBER,
                      P_TRUNCATE          IN VARCHAR2,  -- fix a bug 5765878 to truncate table to perform better by Ehuh 02.19.2007
                      P_SCORE_OBJECT_ID   IN NUMBER ,
                      P_SCORE_OBJECT_CODE IN VARCHAR2 ,
        -- begin bug 4504193 by ctlee 2005/07/26 - update from date to varchar2
                      P_FROM_DATE         IN varchar2 ,
                      P_TO_DATE           IN varchar2 ,
        -- end bug 4504193 by ctlee 2005/07/26 - update from date to varchar2
                      P_REQUEST_ID        IN NUMBER ,
                      P_SAVE_LAST_RUN     IN VARCHAR2,
                      P_BATCH_SIZE        IN NUMBER)
IS

  vPLSQL              VARCHAR2(200);
Line: 1997

  vSelectCount         Varchar2(1000) ;
Line: 2029

    vStr1      := 'SELECT SCORE_HISTORY_ID ' ;
Line: 2031

    v_del_sql  :=  'DELETE FROM IEX_SCORE_HISTORIES ' ;
Line: 2033

    vSelectCount   := 'select count(1) from iex_score_histories ';
Line: 2093

        l_conditions(i).Value := '(SELECT trunc(MAX(creation_date)) FROM iex_Score_histories)'; -- Andre Fixed here so we use date only
Line: 2115

           FND_FILE.PUT_LINE(FND_FILE.LOG, 'Delete Filter Applied => '||  vPLSQL2);
Line: 2130

            FND_FILE.PUT_LINE(FND_FILE.LOG, 'SELECT SCORE_HISTORY_ID ' ||
                                    ' FROM IEX_SCORE_HISTORIES ' ||
                                    vPLSQL2);
Line: 2135

    vPLSQL := '  SELECT Count(1), Score_object_code ' ||
              '    FROM IEX_SCORE_HISTORIES ' ||
              'GROUP BY SCORE_OBJECT_CODE ';
Line: 2158

    /* Removed by Andre 06/18/2004, we will need to delete in chunks
    EXECUTE IMMEDIATE v_del_sql ;
Line: 2194

	EXECUTE IMMEDIATE 'select  IEX_SCORE_HISTORIES_S.NEXTVAL +1 FROM DUAL' into v_num;
Line: 2201

	  EXECUTE IMMEDIATE 'select  IEX_SCORE_HISTORIES_S.NEXTVAL FROM DUAL' into v_num;
Line: 2223

       vSelectCount := vSelectCount || vWhereClause;
Line: 2224

       open sql_cur for vSelectCount;
Line: 2228

       FND_FILE.PUT_LINE(FND_FILE.LOG, 'Final delete statement => '||  v_del_sql);
Line: 2265

        Select Count(1) into l_total
          From IEX_SCORE_HISTORIES;
Line: 2356

    vstr1   := 'SELECT SCORE_HISTORY_ID, ';
Line: 2405

         'SELECT SCORE_HISTORY_ID, ' ||
         '       SCORE_ID, ' ||
         '       SCORE_VALUE, '||
         '       CREATION_DATE ' ||
         ' FROM IEX_SCORE_HISTORIES ' ||
            vPLSQL;
Line: 2483

	  IEX_DEBUG_PUB.logMessage('IEX_SCORE: storeScoreHistory: Insert records!' );
Line: 2501

		select jtf_object_code into l_object_type
		  from iex_scores
		 where score_id = p_score_id;
Line: 2506

		insert into iex_score_histories(SCORE_HISTORY_ID
					      ,SCORE_OBJECT_ID
					      ,SCORE_OBJECT_CODE
					      ,OBJECT_VERSION_NUMBER
					      ,LAST_UPDATE_DATE
					      ,LAST_UPDATED_BY
					      ,LAST_UPDATE_LOGIN
					      ,CREATION_DATE
					      ,CREATED_BY
					      ,SCORE_VALUE
					      ,SCORE_ID
					      ,REQUEST_ID
					      ,PROGRAM_ID
					      ,PROGRAM_APPLICATION_ID
					      ,PROGRAM_UPDATE_DATE
					      ,ORG_ID)
			   values(IEX_SCORE_HISTORIES_S.nextval
				  ,p_objects_tbl(n)
				  ,l_object_type
				  ,1
				  ,sysdate
				  ,l_user
				  ,l_user
				  ,sysdate
				  ,l_user
				  ,p_scores_tbl(n)
				  ,p_score_id
				  ,l_request
				  ,l_program
				  ,l_prog_appl
				  ,SYSDATE
				  ,l_org_id);
Line: 2601

	  IEX_DEBUG_PUB.logMessage('IEX_SCORE: storeDelBuffers: Insert records!' );
Line: 2617

		select jtf_object_code into l_object_type
		  from iex_scores
		 where score_id = p_score_id;
Line: 2623

		insert into IEX_DEL_BUFFERS(DEL_BUFFER_ID
					  ,SCORE_OBJECT_ID
					  ,SCORE_OBJECT_CODE
					  ,OBJECT_VERSION_NUMBER
					  ,LAST_UPDATE_DATE
					  ,LAST_UPDATED_BY
					  ,LAST_UPDATE_LOGIN
					  ,CREATION_DATE
					  ,CREATED_BY
					  ,SCORE_VALUE
					  ,SCORE_ID
					  ,REQUEST_ID
					  ,PROGRAM_ID
					  ,PROGRAM_APPLICATION_ID
					  ,PROGRAM_UPDATE_DATE)
			   values(IEX_DEL_BUFFERS_S.nextval
				  ,p_objects_tbl(n)
				  ,l_object_type
				  ,1
				  ,sysdate
				  ,l_user
				  ,l_user
				  ,sysdate
				  ,l_user
				  ,p_scores_tbl(n)
				  ,p_score_id
				  ,nvl(l_bridge,0)
				  ,l_program
				  ,l_prog_appl
				  ,sysdate);
Line: 2704

    l_execute_style       VARCHAR2(1);  -- are we using select or function call
Line: 2795

                            SELECT Range_Low
                            BULK COLLECT INTO l_component_range_tbl
                              FROM iex_score_comp_det
                             where score_component_id = l_score_component_id
                            order by value;
Line: 2813

                            l_component_range_tbl.delete;
Line: 2817

                                  FND_FILE.PUT_LINE(FND_FILE.LOG, 'IEX_SCORE: get1Score: Exception selecting '||
				                                     'component detail range: WRONG ENGINE CONFIGURATION!!!!!');
Line: 2849

		select sctl.score_comp_name,sc.score_comp_weight
		into l_score_comp_name,l_score_comp_wtg
		from iex_score_components sc, iex_score_comp_types_tl sctl
		where sc.score_comp_type_id=sctl.score_comp_type_id
		and sc.score_component_id=l_score_component_id
		and sctl.language='US';
Line: 2870

                vSql := 'SELECT upper(NEW_VALUE) ' ||
                      '  FROM IEX_SCORE_COMP_DET ' ||
                      ' WHERE SCORE_COMPONENT_ID = :p_score_comp_id AND ' ||
                      '       :p_component_score >= RANGE_LOW AND ' ||
                      '       :p_component_score <= RANGE_HIGH  ';
Line: 2905

		    vSql := 'SELECT ' || l_new_value || ' FROM DUAL';
Line: 3001

    SELECT
            SCORE_COMP_VALUE,
            NVL(FUNCTION_FLAG, 'N') FUNCTION_FLAG
    into l_scorecomp_exe,l_function_flag
        FROM
            IEX_SCORE_COMP_TYPES_VL
        WHERE score_comp_type_id=p_scorecomp_id
          AND NVL(METRIC_FLAG, 'N') = 'N';