DBA Data[Home] [Help]

APPS.HXC_RPT_LOAD_TC_SNAPSHOT SQL Statements

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

Line: 29

      := 'SELECT person_id
            FROM per_all_assignments_f
           WHERE assignment_status_type_id IN ( SELECT assignment_status_type_id
                                                  FROM per_assignment_status_types
                                                 WHERE user_status IN ( ''Active Assignment''
                                                                        ,''Active Contingent Assignment'') )
             AND assignment_type IN (''E'',''C'')
             AND business_group_id = FND_GLOBAL.per_business_group_id
             AND (     effective_start_date BETWEEN ''p_date_from''
                                                AND ''p_date_to''
                    OR effective_end_date BETWEEN ''p_date_from''
                                              AND ''p_date_to''
	            OR ''p_date_from'' BETWEEN effective_start_date
                                           AND effective_end_date
	            OR ''p_date_to''  BETWEEN effective_Start_date
                                          AND effective_end_date )';
Line: 137

        l_resource_list.DELETE;
Line: 170

          ' INSERT INTO hxc_rpt_tc_resource_temp
                        ( resource_id,
                          tc_start_time,
                          tc_stop_time,
                          tc_bb_id,
                          resource_name,
                          request_id )
                  SELECT  resource_id,
                          start_time,
                          stop_time,
                          time_building_block_id,
                          MIN(full_name||'' [''||COALESCE(DECODE(current_employee_flag,''Y'',employee_number),
						          DECODE(current_npw_flag,''Y'',npw_number),
						          '' ''
						         )||'']''),
                          ''p_request_id''
                    FROM  hxc_time_building_blocks hxc,
                          per_all_people_f ppf
                   WHERE  scope       = ''TIMECARD''
                     AND  person_id = resource_id
                     AND  start_time >= effective_start_date
                     AND  stop_time  <= effective_end_date
                     AND  start_time >= ''p_date_from''
                     AND  TRUNC(stop_time)  <= ''p_date_to''
                     AND  resource_id IN ( ';
Line: 237

       hr_utility.trace('Timecard select query is ');
Line: 271

     DELETE FROM hxc_rpt_tc_hist_log;
Line: 273

     DELETE FROM hxc_rpt_tc_details_all;
Line: 305

      IS SELECT /*+ LEADING(gt)
                    USE_NL(gt hist)
		    INDEX(hist HXC_RPT_TC_HIST_LOG_PK) */
                hist.resource_id,
                hist.tc_start_time,
                hist.tc_stop_time,
                hist.history_till_date
           FROM hxc_rpt_tc_hist_log hist,
                hxc_rpt_tc_resource_temp gt
          WHERE gt.resource_id   = hist.resource_id
            AND gt.tc_start_time = hist.tc_start_time
            AND gt.tc_stop_time  = hist.tc_stop_time ;
Line: 354

             UPDATE hxc_rpt_tc_resource_temp
                SET history_from_date = history_tab(i)
              WHERE resource_id   = resource_id_tab(i)
                AND tc_start_time = start_time_tab(i)
                AND tc_stop_time  = stop_time_tab(i);
Line: 361

     history_tab.DELETE;
Line: 362

     resource_id_tab.DELETE;
Line: 363

     start_time_tab.DELETE;
Line: 364

     stop_time_tab.DELETE;
Line: 366

     UPDATE hxc_rpt_tc_resource_temp
        SET history_from_date = hr_general.start_of_time
      WHERE history_from_date IS NULL ;
Line: 387

PROCEDURE update_layout_ids
AS

  CURSOR get_layout_ids
      IS SELECT /*+ LEADING(gt)
                    INDEX(hau HXC_TIME_ATTRIBUTE_USAGES_FK2)
		    INDEX(ha HXC_TIME_ATTRIBUTES_PK) */
                gt.tc_bb_id,
                ha.attribute1
           FROM hxc_rpt_tc_resource_temp    gt,
                hxc_time_attribute_usages hau,
                hxc_time_attributes       ha
          WHERE gt.tc_bb_id = hau.time_building_block_id
            AND hau.time_building_block_ovn = 1
            AND hau.time_attribute_id = ha.time_attribute_id
            AND ha.attribute_category = 'LAYOUT';
Line: 418

         hr_utility.trace('Starting update_layout_ids');
Line: 438

                UPDATE hxc_rpt_tc_resource_temp
                   SET layout_id = l_layout_id_tab(i)
                 WHERE tc_bb_id  = l_tbb_tab(i) ;
Line: 442

         l_layout_id_tab.DELETE;
Line: 443

         l_tbb_tab.DELETE;
Line: 450

         hr_utility.trace('update_layout_ids completed alright');
Line: 457

END update_layout_ids;
Line: 466

PROCEDURE update_last_touched_date
AS

  CURSOR get_last_touched_date
      IS SELECT /*+ ORDERED
                    INDEX(det HXC_RPT_TC_DETAILS_FK2)
		    INDEX(bb HXC_TIME_BUILDING_BLOCKS_PK) */
                bb.time_building_block_id,
                bb.object_version_number,
	        bb.date_to,
	        bb.last_update_date,
                bb.last_updated_by
           FROM hxc_time_building_blocks bb,
                hxc_rpt_tc_details_all det,
	        hxc_rpt_tc_resource_temp gt
          WHERE bb.scope                  = 'DETAIL'
            AND bb.time_building_block_id = det.detail_bb_id
            AND bb.object_version_number  = det.detail_bb_ovn
            AND det.tc_bb_id              = gt.tc_bb_id
            AND det.date_to               <> bb.date_to ;
Line: 490

  update_date_tab  DATETABLE;
Line: 491

  update_user_tab  NUMTABLE;
Line: 510

         hr_utility.trace('Starting update_last_touched_date');
Line: 519

                         update_date_tab,
                         update_user_tab;
Line: 533

             UPDATE hxc_rpt_tc_details_all
                SET last_update_date = update_date_tab(i),
                    last_updated_by = update_user_tab(i),
                    last_updated_by_user = NULL,
                    date_to          = date_to_tab(i)
              WHERE detail_bb_id = bb_id_tab(i)
                AND detail_bb_ovn = bb_ovn_tab(i);
Line: 542

      bb_id_tab.DELETE;
Line: 543

      bb_ovn_tab.DELETE;
Line: 544

      date_to_tab.DELETE;
Line: 545

      update_date_tab.DELETE;
Line: 550

         hr_utility.trace('update_last_touched_date threw NO DATA FOUND');
Line: 552

END update_last_touched_date;
Line: 560

PROCEDURE update_timecard_comments
AS

   CURSOR get_timecard_comments
       IS SELECT /*+ INDEX(det HXC_RPT_TC_DETAILS_FK2)*/
                 comment_text,
                 detail_bb_id,
                 detail_bb_ovn
            FROM hxc_time_building_blocks bb,
                 hxc_rpt_tc_details_all   det,
                 hxc_rpt_tc_resource_temp   gt
           WHERE bb.time_building_block_id = det.tc_bb_id
             AND bb.object_version_number  = det.tc_bb_ovn
             AND bb.comment_text           IS NOT NULL
             AND det.tc_bb_id              = gt.tc_bb_id
             AND det.request_id            = gt.request_id;
Line: 591

       hr_utility.trace('Starting update_timecard_comments');
Line: 612

            UPDATE hxc_rpt_tc_details_all
               SET tc_comments = comment_tab(i)
             WHERE detail_bb_id    = det_bb_tab(i)
               AND detail_bb_ovn   = det_ovn_tab(i);
Line: 618

    det_bb_tab.DELETE;
Line: 619

    det_ovn_tab.DELETE;
Line: 620

    comment_tab.DELETE;
Line: 624

       hr_utility.trace('Completed update_timecard_comments alright');
Line: 632

END update_timecard_comments;
Line: 662

    INSERT INTO hxc_rpt_tc_details_all
                ( resource_id,
                  tc_start_time,
                  tc_stop_time,
                  tc_bb_id,
                  tc_bb_ovn,
                  day_bb_id,
                  day_bb_ovn,
                  day_start_time,
                  day_stop_time,
                  detail_bb_id,
                  detail_bb_ovn,
                  hours_measure,
                  layout_id,
                  detail_comments,
                  creation_date,
                  created_by,
                  last_update_date,
                  last_updated_by,
                  date_from,
                  date_to,
                  request_id,
                  resource_name,
                  day_date_to,
                  status )
          SELECT  gt.resource_id,
                  gt.tc_start_time,
                  gt.tc_stop_time,
                  day.parent_building_block_id,
                  day.parent_building_block_ovn,
                  day.time_building_block_id,
                  day.object_version_number,
                  NVL(detail.start_time,day.start_time),
                  NVL(detail.stop_time,day.stop_time),
                  detail.time_building_block_id,
                  detail.object_version_number,
                  NVL(detail.measure,(detail.stop_time-detail.start_time)*24),
                  gt.layout_id,
                  detail.comment_text,
                  detail.creation_date,
                  detail.created_by,
                  detail.last_update_date,
                  detail.last_updated_by,
                  detail.date_from,
                  detail.date_to,
                  gt.request_id,
                  gt.resource_name,
                  day.date_to,
                  detail.approval_status
            FROM  hxc_rpt_tc_resource_temp    gt,
                  hxc_time_building_blocks  day,
                  hxc_time_building_blocks  detail
           WHERE  gt.tc_bb_id                = day.parent_building_block_id
             AND  gt.resource_id             = day.resource_id
             AND  day.time_building_block_id = detail.parent_building_block_id
             AND  day.object_version_number  = detail.parent_building_block_ovn
             AND  detail.resource_id         = day.resource_id
             AND  detail.creation_date       > gt.history_from_date ;
Line: 747

  IS SELECT 'MAX(DECODE('||DECODE(ATTRIBUTE_CATEGORY,
                                  'ELEMENT','SUBSTR(ATTRIBUTE_CATEGORY,1,7)','ATTRIBUTE_CATEGORY'
                                  )
                    ||','''||attribute_category||''',ha.'||attribute||'))',
             attribute_category,
             component_name,
             row_num
       FROM (  SELECT hlc.layout_id,
                      hlc.layout_component_id,
                      REGEXP_REPLACE(hlc.component_name,'.*- ') component_name,
                      DECODE( hlcq.qualifier_attribute26,
                              'Dummy Element Context','ELEMENT',
                              SUBSTR(hlcq.qualifier_attribute26,1,30)
                             ) attribute_category,
                      SUBSTR(hlcq.qualifier_attribute27,1,30) attribute,
                      RANK() OVER ( ORDER BY hlc.layout_component_id ) row_num
                 FROM hxc_layouts                hl,
	              hxc_layout_components      hlc,
	              hxc_layout_comp_qualifiers hlcq
                WHERE hlc.layout_id                     = hl.layout_id
                  AND hl.layout_id                      = p_curr_layout
                  AND hl.layout_type                    = 'TIMECARD'
                  AND hlcq.layout_component_id          = hlc.layout_component_id
                  AND hlcq.qualifier_attribute25        = 'FLEX'
                  AND hlcq.qualifier_attribute_category IN ('LOV','CHOICE_LIST',
					                    'PACKAGE_CHOICE_LIST',
					                    'TEXT_FIELD',
			  		                    'DESCRIPTIVE_FLEX')
             );
Line: 791

  dynamic_cursor_select VARCHAR2(1000);
Line: 792

  l_dynamic_cursor_select VARCHAR2(1000) :=
  '     CURSOR get_attributes IS
         SELECT det.detail_bb_id,
                det.detail_bb_ovn,
                MAX(DECODE(ATTRIBUTE_CATEGORY,''REASON'',ha.ATTRIBUTE1)),
                MAX(DECODE(ATTRIBUTE_CATEGORY,''REASON'',ha.ATTRIBUTE2)),
                MAX(DECODE(ATTRIBUTE_CATEGORY,''REASON'',ha.ATTRIBUTE3)),
                ';
Line: 837

  dynamic_update VARCHAR2(2000);
Line: 838

  l_dynamic_update VARCHAR2(2000) :=
   ' IF det_bb_id_tab.COUNT > 0 THEN
     FORALL i IN det_bb_id_tab.FIRST..det_bb_id_tab.LAST
             UPDATE hxc_rpt_tc_details_all
                SET cla_reason = cla_reason_tab(i),
                    cla_comments = cla_comments_tab(i),
                    cla_type     = cla_type_tab(i),';
Line: 845

  dynamic_update_where VARCHAR2(1000);
Line: 846

  l_dynamic_update_where VARCHAR2(1000) :=
   '
              WHERE detail_bb_id = det_bb_id_tab(i)
                AND detail_bb_ovn = det_bb_ovn_tab(i);
Line: 888

     dynamic_cursor_select    := l_dynamic_cursor_select;
Line: 893

     dynamic_update           := l_dynamic_update;
Line: 894

     dynamic_update_where     := l_dynamic_update_where;
Line: 1061

           dynamic_cursor_select := dynamic_cursor_select||l_layout_fld_column||'
           ,';
Line: 1065

           dynamic_update := dynamic_update||'attribute'||l_layout_fld_rownum||
                             ' = display_val'||l_layout_fld_rownum||'(i),';
Line: 1091

    dynamic_cursor_select := RTRIM(dynamic_cursor_select,',');
Line: 1096

    dynamic_update        := RTRIM(dynamic_update,',');
Line: 1105

	hr_utility.trace(dynamic_cursor_select);
Line: 1110

	hr_utility.trace(dynamic_update);
Line: 1111

	hr_utility.trace(dynamic_update_where);
Line: 1117

                     dynamic_cursor_select||
                     dynamic_cursor_where||
                     dynamic_cursor_group_by||
                     dynamic_cursor_open||
                     dynamic_cursor_close||
                     dynamic_update||
                     dynamic_update_where||
                     dynamic_footer;
Line: 1155

      IS SELECT attribute||' = '''||component_name||':  ''||NVL(('||query||'hx.'||attribute||'),hx.'||attribute||')'
           FROM hxc_rpt_layout_comp_queries
          WHERE layout_id = p_layout;
Line: 1159

  l_update VARCHAR2(4000);
Line: 1162

  l_update_predicate VARCHAR2(4000) :=
  '    UPDATE /*+ INDEX(hx HXC_RPT_TC_DETAILS_FK2) */
              hxc_rpt_tc_details_all hx
          SET ';
Line: 1167

  l_update_where VARCHAR2(4000) :=
  '     WHERE tc_bb_id IN ( SELECT tc_bb_id
                              FROM hxc_rpt_tc_resource_temp gt
                             WHERE layout_id = current_layout
                           )
          AND request_id = THIS_REQUEST_ID';
Line: 1198

       l_update := l_update_predicate||curr_query||l_update_where;
Line: 1199

       l_update := REPLACE(l_update,'current_layout',l_curr_layout);
Line: 1200

       l_update := REPLACE(l_update,'THIS_REQUEST_ID',g_request_id);
Line: 1203

          hr_utility.trace('Dynamic Update query is ');
Line: 1204

          hr_utility.trace(l_update);
Line: 1208

           EXECUTE IMMEDIATE l_update;
Line: 1240

      IS SELECT DISTINCT alias_definition_id
           FROM hxc_rpt_tc_resource_temp
          WHERE layout_id = p_layout_id
            AND alias_definition_id <> 0;
Line: 1250

  IS SELECT 'MAX(DECODE(bld_blk_info_type_id,'||hmc.bld_blk_info_type_id||','
            ||DECODE(segment,'ATTRIBUTE_CATEGORY','LTRIM(ha.'||segment||','''||building_block_category||' - '')','ha.'||segment)||'))',
            hatc.component_type
       FROM hxc_mapping_components        hmc,
            hxc_alias_types               hat,
            hxc_alias_type_components     hatc,
            hxc_alias_definitions         had,
            hxc_bld_blk_info_type_usages  bldu,
            hxc_bld_blk_info_types        bld
      WHERE had.alias_type_id             = hat.alias_type_id
        AND hatc.alias_type_id            = hat.alias_type_id
        AND hmc.mapping_component_id      = hatc.mapping_component_id
        AND bld.bld_blk_info_type_id      = hmc.bld_blk_info_type_id
        AND bld.bld_blk_info_type_id      = hmc.bld_blk_info_type_id
        AND bld.bld_blk_info_type_id      = bldu.bld_blk_info_type_id
        AND had.alias_definition_id       = p_alias_def
      ORDER
         BY hatc.component_type ;
Line: 1275

      SELECT detail_bb_id,
             detail_bb_ovn,
             ';
Line: 1304

     SELECT alias_value_name
       FROM hxc_alias_values
      WHERE alias_definition_id = curr_alias_def
        AND ';
Line: 1346

           UPDATE hxc_rpt_tc_details_all
              set attributeATTR_COL = ''ALIASNAME:  ''||alias_value(i)
            WHERE detail_bb_id = det_bb_id_tab(i)
              AND detail_bb_ovn = det_bb_ovn_tab(i);
Line: 1519

          UPDATE hxc_rpt_tc_resource_temp
             SET alias_definition_id =  NVL( hxc_preference_evaluation.resource_preferences
                                                          (resource_id,
                                                           'TC_W_TCRD_ALIASES',
                                                            i,
                                                            tc_start_time),0)
           WHERE layout_id = l_curr_layout;
Line: 1529

               hr_utility.trace('Updated alias definition ids for current list of resources ');
Line: 1647

      IS SELECT flv.meaning,
                rtrim(substr(flv.lookup_type,5,6),'_A'),
                det.detail_bb_id,
                det.detail_bb_ovn
           FROM hxc_rpt_tc_details_all  det,
                hxc_rpt_tc_resource_temp  gt,
                fnd_lookup_values       flv
          WHERE gt.request_id           = det.request_id
            AND gt.resource_id          = det.resource_id
            AND gt.tc_start_time        = det.tc_start_time
            AND gt.tc_stop_time         = det.tc_stop_time
            AND flv.lookup_code         = det.cla_reason
            AND flv.language            = userenv('LANG')
            AND flv.lookup_type         IN ( 'HXC_CHANGE_AUDIT_REASONS',
                                             'HXC_LATE_AUDIT_REASONS')
            AND flv.view_application_id = 3
            AND flv.security_group_id   = FND_GLOBAL.lookup_security_group(flv.lookup_type,
                                                                           flv.view_application_id);
Line: 1703

             UPDATE hxc_rpt_tc_details_all
                SET cla_reason     = l_meaning_tab(i)
              WHERE detail_bb_id   = l_det_bb_id_tab(i)
                AND detail_bb_ovn  = l_det_bb_ovn_tab(i)
                AND cla_type       = l_type_tab(i) ;
Line: 1709

         l_meaning_tab.DELETE;
Line: 1710

         l_det_bb_id_tab.DELETE;
Line: 1711

         l_det_bb_ovn_tab.DELETE;
Line: 1712

         l_type_tab.DELETE;
Line: 1737

PROCEDURE  update_transaction_ids(p_record_save    IN VARCHAR2)
AS

  CURSOR get_transaction_details
      IS SELECT /*+ INDEX(det HXC_RPT_TC_DETAILS_FK1) */
                htd.transaction_id,
                htd.transaction_detail_id,
                det.detail_bb_id,
                det.detail_bb_ovn
           FROM hxc_rpt_tc_details_all   det,
                hxc_rpt_tc_resource_temp   gt,
                hxc_transaction_details  htd,
                hxc_transactions         ht
          WHERE gt.tc_start_time        = det.tc_start_time
            AND gt.tc_stop_time         = det.tc_stop_time
            AND gt.resource_id          = det.resource_id
            AND det.detail_bb_id        = htd.time_building_block_id
            AND det.detail_bb_ovn       = htd.time_building_block_ovn
            AND htd.transaction_id      = ht.transaction_id
            AND ht.type                 = 'DEPOSIT'
            AND ht.status               = 'SUCCESS'
            AND htd.status              = 'SUCCESS';
Line: 1784

      IS SELECT DISTINCT creation_date,
	        transaction_id,
		resource_id,
		tc_start_time,
		tc_stop_time,
	        dense,
		ROUND(PERCENT_RANK() OVER(PARTITION BY resource_id,
                                                       tc_start_time,
                                                       tc_stop_time
					  ORDER BY creation_date),5)
  	   FROM ( SELECT creation_date,
	                 transaction_id,
			 DENSE_RANK() OVER(PARTITION BY det.resource_id,
                                                        det.tc_start_time,
                                                        det.tc_stop_time
                                               ORDER BY creation_date) dense,
		         det.resource_id,
		         det.tc_start_time,
		         det.tc_stop_time
                  FROM hxc_rpt_tc_details_all det,
                       hxc_rpt_tc_resource_temp temp
	         WHERE temp.resource_id = det.resource_id
	           AND temp.tc_start_time = det.tc_start_time
	           AND temp.tc_stop_time = det.tc_stop_time
		)
	  ORDER BY resource_id,
	           tc_start_time,
	           tc_stop_time,
	           dense ;
Line: 1921

       hr_utility.trace('update_transaction_ids');
Line: 1943

            UPDATE hxc_rpt_tc_details_all
               SET transaction_id        = det_trans_id_tab(i),
                   transaction_detail_id = det_trans_detail_id_tab(i)
             WHERE detail_bb_id          = det_bb_id_tab(i)
               AND detail_bb_ovn         = det_bb_ovn_tab(i);
Line: 1950

       det_bb_id_tab.DELETE;
Line: 1951

       det_bb_ovn_tab.DELETE;
Line: 1952

       det_trans_id_tab.DELETE;
Line: 1953

       det_trans_detail_id_tab.DELETE;
Line: 2032

              UPDATE hxc_rpt_tc_details_all
                 SET transaction_id = trans_tab(i)+fac_tab(i)
               WHERE resource_id = res_id_tab(i)
                 AND tc_start_time = start_timetab(i)
                 AND tc_stop_time = stop_timetab(i)
                 AND creation_date = creation_tab(i)
                 AND transaction_id IS NULL;
Line: 2041

           res_id_tab.DELETE;
Line: 2042

           start_timetab.DELETE;
Line: 2043

           stop_timetab.DELETE;
Line: 2044

           creation_tab.DELETE;
Line: 2045

           trans_tab.DELETE;
Line: 2053

       hr_utility.trace('update_transaction_ids completed alright');
Line: 2061

             hr_utility.trace('No Data Found from update_transaction_ids');
Line: 2064

END update_transaction_ids;
Line: 2074

      IS SELECT /*+ ORDERED */
                det.detail_bb_id,
                det.detail_bb_ovn,
                fnd.user_name||newline||'['||
                ppf.full_name||']'
           FROM hxc_rpt_tc_resource_temp gt,
                hxc_rpt_tc_details_all det,
                fnd_user               fnd,
                per_all_people_f       ppf
          WHERE gt.tc_bb_id           = det.tc_bb_id
            AND gt.request_id         = p_request_id
            AND det.created_by        = fnd.user_id
            AND fnd.employee_id       = ppf.person_id
            AND det.day_start_time BETWEEN ppf.effective_start_date
                                       AND ppf.effective_end_date
            AND det.created_by_user IS NULL ;
Line: 2127

           UPDATE hxc_rpt_tc_details_all
              SET created_by_user  = l_person_tab(i)
            WHERE detail_bb_id     = l_bb_id_tab(i)
              AND detail_bb_ovn    = l_bb_ovn_tab(i);
Line: 2132

       l_bb_id_tab.DELETE;
Line: 2133

       l_bb_ovn_tab.DELETE;
Line: 2134

       l_person_tab.DELETE;
Line: 2156

PROCEDURE translate_last_updated_by
AS

  CURSOR get_updated_user  ( p_request_id VARCHAR2)
      IS SELECT /*+ ORDERED */
                det.detail_bb_id,
                det.detail_bb_ovn,
                fnd.user_name||newline||'['||
                ppf.full_name||']'
           FROM hxc_rpt_tc_resource_temp gt,
                hxc_rpt_tc_details_all det,
                fnd_user               fnd,
                per_all_people_f       ppf
          WHERE gt.tc_bb_id           = det.tc_bb_id
            AND gt.request_id         = p_request_id
            AND det.last_updated_by   = fnd.user_id
            AND fnd.employee_id       = ppf.person_id
            AND det.day_start_time BETWEEN ppf.effective_start_date
                                       AND ppf.effective_end_date
            AND det.last_updated_by_user IS NULL ;
Line: 2192

       hr_utility.trace('translate_last_updated_by');
Line: 2197

    OPEN get_updated_user(g_request_id);
Line: 2199

    FETCH get_updated_user BULK COLLECT INTO l_bb_id_tab,
                                             l_bb_ovn_tab,
                                             l_person_tab ;
Line: 2203

    CLOSE get_updated_user;
Line: 2208

       hr_utility.trace('Fetched from get_updated_user ');
Line: 2216

           UPDATE hxc_rpt_tc_details_all
              SET last_updated_by_user  = l_person_tab(i)
            WHERE detail_bb_id          = l_bb_id_tab(i)
              AND detail_bb_ovn         = l_bb_ovn_tab(i);
Line: 2221

       l_bb_id_tab.DELETE;
Line: 2222

       l_bb_ovn_tab.DELETE;
Line: 2223

       l_person_tab.DELETE;
Line: 2230

       hr_utility.trace('translate_last_updated_by completed alright');
Line: 2236

         hr_utility.trace('No Data Found from translate_last_updated_by, something wrong');
Line: 2238

END translate_last_updated_by;
Line: 2269

     UPDATE hxc_rpt_tc_hist_log
        SET request_id        = p_request_id,
            history_till_date = p_request_sysdate
      WHERE (resource_id,
             tc_start_time,
             tc_stop_time)
         IN ( SELECT resource_id,
                     tc_start_time,
                     tc_stop_time
                FROM hxc_rpt_tc_resource_temp )
       RETURNING resource_id,
                 tc_start_time,
                 tc_stop_time BULK COLLECT INTO resource_id_tab,
                                                start_time_tab,
                                                stop_time_tab ;
Line: 2287

       hr_utility.trace('Updated hxc_rpt_tc_hist_log ');
Line: 2288

       hr_utility.trace('Total Number of timecards updated here : '||resource_id_tab.COUNT);
Line: 2294

            DELETE FROM hxc_rpt_tc_resource_temp
                  WHERE resource_id   = resource_id_tab(i)
                    AND tc_start_time = start_time_tab(i)
                    AND tc_stop_time  = stop_time_tab(i);
Line: 2301

    INSERT INTO hxc_rpt_tc_hist_log
                 ( resource_id,
                   tc_start_time,
                   tc_stop_time,
                   request_id,
                   history_till_date )
        SELECT resource_id,
               tc_start_time,
               tc_stop_time,
               MIN(p_request_id),
               MIN(p_request_sysdate)
          FROM hxc_rpt_tc_resource_temp
         GROUP BY resource_id,
                  tc_start_time,
                  tc_stop_time;
Line: 2318

    resource_id_tab.DELETE;
Line: 2319

    start_time_tab.DELETE;
Line: 2320

    stop_time_tab.DELETE;
Line: 2357

    IS SELECT DISTINCT layout_id
         FROM hxc_rpt_tc_resource_temp;
Line: 2436

   DELETE FROM hxc_rpt_tc_resource_temp;
Line: 2460

          SELECT count(*)
            INTO timecard_exists
            FROM hxc_rpt_tc_resource_temp
           WHERE rownum < 2;
Line: 2481

                   hr_utility.trace('Using history data, so update Last Touched Dates');
Line: 2483

                update_last_touched_date;
Line: 2486

             update_layout_ids;
Line: 2490

             update_timecard_comments;
Line: 2515

             update_transaction_ids(p_record_save);
Line: 2517

             translate_last_updated_by;
Line: 2526

             DELETE FROM hxc_rpt_tc_resource_temp;
Line: 2553

PROCEDURE insert_queries(p_vo_name VARCHAR2,
                         p_query   VARCHAR2)
AS

  layout_tab      NUMTABLE;
Line: 2563

  IS SELECT layout_id,
            layout_component_id,
            component_name,
            attribute
       FROM (
             SELECT /*+ INDEX( hlc  HXC_LAYOUT_COMPONENTS_FK1 )
                        INDEX( hlcq HXC_LAYOUT_COMP_QUALIFIERS_FK1) */
                      hlc.layout_id                                           ,
                      hlc.layout_component_id                                 ,
	              REGEXP_REPLACE(hlc.component_name,'.*- ') component_name,
                      hlcq.qualifier_attribute1      vo_name,
		      'ATTRIBUTE'||RANK() OVER ( PARTITION BY hlc.layout_id
        		                             ORDER BY hlc.layout_component_id ) AS attribute
               FROM hxc_layouts                hl,
	            hxc_layout_components      hlc,
        	    hxc_layout_comp_qualifiers hlcq
              WHERE hlc.layout_id                     = hl.layout_id
                AND hl.layout_type                    = 'TIMECARD'
                AND hlcq.layout_component_id          = hlc.layout_component_id
                AND hlcq.qualifier_attribute25        = 'FLEX'
                AND hlcq.qualifier_attribute_category IN ('LOV',
                                                          'CHOICE_LIST',
	                       			          'PACKAGE_CHOICE_LIST',
					                  'TEXT_FIELD',
					                  'DESCRIPTIVE_FLEX')
        ) layout_all
      WHERE layout_all.vo_name = p_vo_name ;
Line: 2614

            DELETE FROM hxc_rpt_layout_comp_queries
                  WHERE layout_component_id = layout_comp_tab(i);
Line: 2618

            DELETE FROM hxc_rpt_layout_comp_queries
                  WHERE layout_id = layout_tab(i)
                    AND attribute = attribute_tab(i);
Line: 2623

             INSERT INTO hxc_rpt_layout_comp_queries
                         ( layout_id,
                           layout_component_id,
                           component_name,
                           query,
                           attribute )
                  VALUES ( layout_tab(i),
                           layout_comp_tab(i),
                           comp_tab(i),
                           p_query,
                           attribute_tab(i) );
Line: 2641

END insert_queries;