DBA Data[Home] [Help]

APPS.BIX_KPI_AGENT_RPT_PKG SQL Statements

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

Line: 37

  SELECT fnd_profile.value('BIX_DM_PREFERRED_CURRENCY')
  INTO   l_global_curr
  FROM   dual;
Line: 42

  SELECT fnd_profile.value('JTF_PROFILE_DEFAULT_CURRENCY')
  INTO   l_user_curr
  FROM   dual;
Line: 54

    SELECT fnd_profile.value('BIX_DM_CURR_CONVERSION_TYPE')
    INTO   l_conv_type
    FROM   dual;
Line: 75

  /* Form the SQL string to insert the rows into the temp table */
  g_sqlstmt := '
    INSERT /*+ PARALLEL(tr,2) */ INTO bix_dm_report tr (
			    session_id
			 ,  report_code
			 ,  col3
			 ,  col4
			 ,  col5
			 ,  col6
			 ,  col8
			 ,  col10
			 ,  col12
			 ,  col14
			 ,  col16
			 ,  col18
			 ,  col20
			 ,  col22
			 ,  col24
			 ,  col26
			 ,  col28
			 ,  col30
			 ,  col32
			 ,  col34
			 ,  col36
			 ,  col38
			 ,  col40 )
  (SELECT /*+ PARALLEL(a,2) */
			   :session_id
			 , ''BIX_KPI_AGENT_RPT'' ';
Line: 154

                , trunc(SUM(leads_updated))
                , to_char(((SUM(leads_amount)) / :denom_rate) * :num_rate, :format_mask)
                , trunc(SUM(opportunities_created))
                , trunc(SUM(opportunities_updated))
                , trunc(SUM(opportunities_won))
                , to_char(((SUM(opportunities_won_amount)) / :denom_rate) * :num_rate, :format_mask) ';
Line: 242

  /* Form the SQL string to insert the rows into the temp table */
  g_sqlstmt := '
    INSERT /*+ PARALLEL(tr,2) */ INTO bix_dm_report tr (
			    session_id
			 ,  report_code
			 ,  col2
			 ,  col3
			 ,  col4
			 ,  col5
			 ,  col8
			 ,  col10
			 ,  col12
			 ,  col14
			 ,  col16
			 ,  col18
			 ,  col20
			 ,  col22
			 ,  col24
			 ,  col26
			 ,  col28
			 ,  col30
			 ,  col32
			 ,  col34
			 ,  col36
			 ,  col38
			 ,  col40 )

  (SELECT /*+ PARALLEL(a,2) */
			   :session_id
			 , ''BIX_KPI_AGENT_RPT'' ';
Line: 310

                , trunc(SUM(leads_updated))
                , to_char(((SUM(leads_amount)) / :denom_rate) * :num_rate, :format_mask)
                , trunc(SUM(opportunities_created))
                , trunc(SUM(opportunities_updated))
                , trunc(SUM(opportunities_won))
                , to_char(((SUM(opportunities_won_amount)) / :denom_rate) * :num_rate, :format_mask) ';
Line: 384

/* This procedure form and execute the SQL statement to insert into */
/* BIX temp table all the detail rows of a resource                 */
PROCEDURE insert_rs_detail_temp_table(p_agent_id IN NUMBER)
IS
BEGIN

  /* Form and execute the SQL statement to insert into the temp table  */
  /* all the detail rows corresponding to the agent p_agent_id         */
  form_rs_sqlstmt(FALSE);
Line: 399

END insert_rs_detail_temp_table;
Line: 403

/* insert into BIX temp table the total row of a resource */
PROCEDURE insert_rs_total_temp_table(p_group_id IN NUMBER)
IS
BEGIN

  /* Form and execute the SQL statement to insert into the temp table one  */
  /* row for each of the agents which belong to the agent group p_group_id */
  form_rs_sqlstmt(TRUE);
Line: 417

END insert_rs_total_temp_table;
Line: 419

/* This procedure form and execute the SQL statement to insert both */
/* the detail and total row for the agent group                     */
PROCEDURE insert_group_temp_table(p_group_id IN NUMBER)
IS
BEGIN

  /* Form and execute the SQL statement to insert into the temp table */
  /* the total row corresponding to the agent group "p_group_id"      */
  form_group_sqlstmt(TRUE);
Line: 431

  /* Form and execute the SQL statement to insert into the temp table one row for each */
  /* of the agent groups which are immediate children of the group p_group_id          */
  form_group_sqlstmt(FALSE);
Line: 440

END insert_group_temp_table;
Line: 466

    SELECT MAX(period_start_date)
    INTO   l_temp_date
    FROM   bix_dm_agent_call_sum;
Line: 474

    /* Period Indicator = 7 indicates that user has selected today as reporting period */
    g_from_date := to_date(to_char(g_sysdate, 'dd/mm/yyyy') || ' 00:00:00','dd/mm/yyyy hh24:mi:ss');
Line: 479

    /* Period Indicator = 8 indicates that user has selected yesterday as reporting period */
    g_from_date := to_date(to_char(g_sysdate-1, 'dd/mm/yyyy') || ' 00:00:00','dd/mm/yyyy hh24:mi:ss');
Line: 512

  SELECT icx_sec.g_session_id
  INTO   g_session_id
  FROM   dual;
Line: 516

  /* Delete the rows from the table bix_dm_report for the current icx session and report  */
  /* so that we donot display the leftover rows from the previous execution of the report */
  DELETE bix_dm_report
  WHERE  report_code = 'BIX_KPI_AGENT_RPT'
  AND    session_id  = g_session_id;
Line: 523

  SELECT sysdate
  INTO   g_sysdate
  FROM   dual;
Line: 532

  SELECT fnd_profile.value('BIX_DM_RPT_TIME_RANGE')
  INTO   g_time_range
  FROM   dual;
Line: 554

    SELECT TO_NUMBER(substr(g_parent, 2, decode(instr(g_parent,'c'), 0, length(g_parent), instr(g_parent,'c')-2)))
    INTO   l_group_id
    FROM   dual;
Line: 563

  /* If the user has selected "All" for agent group paramter , display the default group of the user */
  IF (l_group_id = -999) THEN
    SELECT fnd_profile.value('BIX_DM_DEFAULT_GROUP')
    INTO   l_group_id
    FROM   dual;
Line: 570

  /* l_group_id = "null" : user has selected "All" as agent group paramter and (s)he is not assigned to any default group */
  IF (l_group_id IS NULL) THEN
    RETURN;
Line: 576

  insert_group_temp_table(l_group_id);
Line: 579

  insert_rs_total_temp_table(l_group_id);
Line: 582

  /* to insert the detail rows of the agent into the temp table     */
  IF (instr(g_parent,'c') <> 0) THEN
    l_agent_id := TO_NUMBER(substr(g_parent, instr(g_parent, 'c')+1, length(g_parent) - (instr(g_parent,'c')+1)));
Line: 589

	 /* Update the temp table so that next time the user clicked on the */
	 /* same agent we donot display the detail rows of the agent again  */
	 UPDATE bix_dm_report
	 SET col3          = 'p' || l_group_id || 'c' || to_char(l_agent_id) || 'y'
	 WHERE col3        = 'p' || l_group_id || 'c' || to_char(l_agent_id) || 'n'
      AND   report_code = 'BIX_KPI_AGENT_RPT'
      AND   session_id  = g_session_id;
Line: 598

      /* summary table and insert them into bix temp table    */
      insert_rs_detail_temp_table(l_agent_id);