DBA Data[Home] [Help]

APPS.OKS_MASSCHANGE_PVT SQL Statements

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

Line: 25

	   l_select                Varchar2(2000);
Line: 44

 	           l_select :='SELECT distinct okh.id,
                                  okh.contract_number,
                                  okh.contract_number_modifier,
                                  okh.start_date,
                                  okh.end_date,
                                  okh.short_description,
                                  okh.sts_code,
                                  oxp.name party
                                  ,org.name
				   ,okh.billed_at_source';
Line: 65

                                 SELECT ole.subject_chr_id
                                 FROM  okc_operation_instances_v oie,
                                       okc_operation_lines_v ole,
                                       okc_class_operations_v oco
                                 WHERE oie.id = ole.oie_id
                                 AND   oie.id = :p_ctr_rec_oie_id
                                 AND   oie.cop_id = oco.id AND   opn_code = ''MASS_CHANGE'')
		                AND oas.sts_code = okh.sts_code
	                        AND oas.opn_code = ''UPDATE''
		          	AND oas.scs_code = okh.scs_code
				AND  ocl.chr_id = okh.id
				AND  nvl(ocl.upg_orig_system_ref,''X'') <> ''MIG_NOBILL''
		        AND okh.id = okp.chr_id
			AND okp.rle_code in ( ''CUSTOMER'',''SUBSCRIBER'')
    	                AND okp.object1_id1 = oxp.id1
	                And  org.organization_id = okh.authoring_org_id
	                AND oxp.id2 = ''#'''  ;
Line: 87

                                 AND oas.opn_code = ''UPDATE''
                                 AND oas.scs_code = okh.scs_code
                                  AND  ocl.chr_id = okh.id
                                  AND  nvl(ocl.upg_orig_system_ref,''X'') <> ''MIG_NOBILL''
                   AND okh.id = okp.chr_id
                   AND okp.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                   AND okp.object1_id1 = oxp.id1
                   And  org.organization_id = okh.authoring_org_id
                   AND oxp.id2 = ''#''';
Line: 105

                     AND  okh.id not in ( SELECT ole.subject_chr_id
                                 FROM  okc_operation_instances_v oie,
                                       okc_operation_lines_v ole,
                                       okc_class_operations_v oco
                                 WHERE oie.id = ole.oie_id
                                 AND   oie.id = :p_ctr_rec_oie_id
                                 AND   oie.cop_id = oco.id AND   opn_code = ''MASS_CHANGE'')
	                         AND oas.sts_code = okh.sts_code
                                AND oas.opn_code = ''UPDATE''
		                AND oas.scs_code = okh.scs_code
                                  AND  ocl.chr_id = okh.id
                                  AND  ocl.lse_id <> 14
                                  AND   nvl(ocl.upg_orig_system_ref,''X'') <> ''MIG_NOBILL''
                    AND okh.id = okp.chr_id
                    AND okp.rle_code in ( ''CUSTOMER'',''SUBSCRIBER'')
                    AND okp.object1_id1 = oxp.id1
                    And  org.organization_id = okh.authoring_org_id
                    AND oxp.id2 = ''#'''  ;
Line: 128

                                 AND   oas.opn_code = ''UPDATE''
                                 AND   oas.scs_code = okh.scs_code
                                 AND   ocl.chr_id = okh.id
                                 AND   ocl.lse_id <> 14
                                 AND   nvl(ocl.upg_orig_system_ref,''X'') <> ''MIG_NOBILL''
                   AND okh.id = okp.chr_id
                   AND okp.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                   AND okp.object1_id1 = oxp.id1
                   And org.organization_id = okh.authoring_org_id
                   AND oxp.id2 = ''#''';
Line: 144

	     l_select :='SELECT okh.id,
                            okh.contract_number,
                            okh.contract_number_modifier,
                            okh.start_date,
                            okh.end_date,
                            okh.short_description,
                            okh.sts_code,
                            okh.qcl_id ,
                            okh.object_version_number,
                            ole.id ole_id,
                            okh.org_id,
                            mod.qa_check_yn,
                            org.name ,
			    okh.billed_at_source';
Line: 160

      	l_where:=' WHERE ole.select_yn = ''Y''
	           AND   ole.process_flag IN (''A'',''E'')
                   AND   okh.id = ole.subject_chr_id
                   AND   ole.oie_id = :p_ctr_rec_oie_id
                   AND   mod.ole_id = ole.id
                   And  org.organization_id = okh.authoring_org_id ';
Line: 177

 IF p_ctr_rec.update_level = 'OKS_K_HEADER' THEN

 --------------------------------------------------------
 --  Update Level : Contract , Attribute: Revenue Account(REV_ACCT)
 --------------------------------------------------------
      IF p_ctr_rec.attribute = 'REV_ACCT' THEN

       -- Old Value: NULL (-9999)
	     IF p_ctr_rec.old_value = '-9999' THEN   -- For old Value as NULL
             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id is NULL)
                        AND okh.id = to_number(:update_level_value)' ; --||to_number(p_ctr_rec.update_level_value);
Line: 196

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id)
                        AND okh.id = to_number(:update_level_value)';
Line: 206

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id = to_number(:p_ctr_rec_old_value))
                        AND okh.id = to_number(:update_level_value)';
Line: 222

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                       ' AND  okh.PAYMENT_TERM_ID is NULL
                         AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 228

                       l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                               'AND okh.id = to_number(:update_level_value)';
Line: 235

             l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.PAYMENT_TERM_ID = to_number(:p_ctr_rec_old_value)
                         AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 250

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                       ' AND  okh.renewal_type_code is NULL
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 269

                       l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||l_where||
                                ' AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                                AND okh.id = to_number(:update_level_value)';
Line: 288

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||', oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND   (okh.renewal_type_code = ''NSR''
                                 AND ''ERN'' = :p_ctr_rec_old_value
                                 AND oksh.ELECTRONIC_RENEWAL_FLAG =''Y'')
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                        AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 312

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||', oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND  okh.renewal_type_code = :p_ctr_rec_old_value
                        AND  nvl(oksh.ELECTRONIC_RENEWAL_FLAG,''N'') <>''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                        AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 340

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||
                        l_where|| 'AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21)
                                            AND cln.price_list_id is NULL)
                                   AND  okh.id = to_number(:update_level_value)';
Line: 351

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21))
                                   AND  okh.id = to_number(:update_level_value)';
Line: 361

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                      Where cln.dnz_chr_id = okh.id
                                      AND cln.lse_id in(3,16,21)
                                      AND cln.price_list_id = to_number(:p_ctr_rec_old_value))
                                  AND  okh.id = to_number(:update_level_value)';
Line: 380

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where|| 'AND oksh.chr_id = okh.id
                                   AND oksh.acct_rule_id IS NULL
                                   AND  okh.id = to_number(:update_level_value)';
Line: 388

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND  okh.id = to_number(:update_level_value)';
Line: 395

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND oksh.acct_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND  okh.id = to_number(:update_level_value)';
Line: 410

             l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                             ' AND  okh.inv_rule_id IS NULL
                               AND  okh.id = to_number(:update_level_value) ';
Line: 416

                    l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                              l_from||l_where||
                                    ' AND  okh.id = to_number(:update_level_value) ';
Line: 424

                l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                          l_from||l_where||
                                ' AND  okh.inv_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND  okh.id = to_number(:update_level_value) ';
Line: 438

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V okl, oks_k_lines_v oksl
                                             WHERE okl.dnz_chr_id = okh.id
                                             AND oksl.cle_id = okl.id
                                             AND oksl.coverage_type is NULL )
                        AND  okh.id = to_number(:update_level_value)' ;
Line: 451

                l_stmt := l_select||' , :l_old_value old_value'||
                          l_from||
                          l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                    WHERE okl.dnz_chr_id = okh.id
                                    AND oksl.cle_id = okl.id )
                        AND  okh.id = to_number(:update_level_value)' ;
Line: 459

                 l_stmt := l_select||' , :l_old_value old_value'||
                           l_from||
                           l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                     WHERE okl.dnz_chr_id = okh.id
                                     AND oksl.cle_id = okl.id
                                     AND oksl.coverage_type = :p_ctr_rec_old_value )
                        AND  okh.id = to_number(:update_level_value)' ;
Line: 476

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                      WHERE ctz.dnz_chr_id = okh.id
                                      AND   ctz.timezone_id IS NULL )
                         AND   okh.id = to_number(:update_level_value)';
Line: 487

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND   ctz.timezone_id IS NOT NULL )
                                             AND   okh.id = to_number(:update_level_value)';
Line: 497

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND  ctz.timezone_id = to_number(:p_ctr_rec_old_value))
                                             AND  okh.id = to_number(:update_level_value)';
Line: 513

                l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE'')
                                             AND  okh.id = to_number(:update_level_value)';
Line: 524

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND  okh.id = to_number(:update_level_value)';
Line: 543

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP'')
                                             AND  okh.id = to_number(:update_level_value)';
Line: 554

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND   okh.id = to_number(:update_level_value)';
Line: 573

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from okc_governances_v ogv
                                             WHERE ogv.dnz_chr_id = okh.id
                                             AND   ogv.isa_agreement_id = :p_ctr_rec_old_value)
                                             AND  okh.id = to_number(:update_level_value)';
Line: 586

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen is NULL)
                        AND okh.id = to_number(:update_level_value)';
Line: 597

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35))
                        AND okh.id = to_number(:update_level_value)';
Line: 609

            l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                         WHERE cle.dnz_chr_id = okh.id
                         AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                         AND   cle.cognomen = :p_ctr_rec_old_value)
                        AND okh.id = to_number(:update_level_value)';
Line: 627

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen is NULL)
                        AND okh.id = to_number(:update_level_value)';
Line: 638

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19))
                                     AND okh.id = to_number(:update_level_value)';
Line: 650

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                        AND okh.id = to_number(:update_level_value)';
Line: 667

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                ' AND  okh.ship_to_site_use_id is NULL
                                  AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 675

                 l_stmt := l_select||' ,okh.ship_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.ship_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 688

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id is NULL
                                     AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 695

                 l_stmt := l_select||' ,okh.bill_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND  okh.id = to_number(:p_ctr_rec_old_value) ';
Line: 709

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND (EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                        OR EXISTS (Select ''x'' from oks_k_sales_credits_v osc
                                   Where osc.chr_id = okh.id
                                   and osc.ctc_id is NULL))
                        AND okh.id = to_number(:update_level_value)';
Line: 725

             l_stmt := l_select||' ,oc.object1_id1 old_value '||
                       l_from||', okc_contacts oc '||
                       l_where||' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SALESPERSON''
                          and   oc.jtot_object1_code = ''OKX_SALEPERS''
                       AND okh.id = to_number(:update_level_value)';
Line: 736

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND (EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                        OR EXISTS (Select ''x'' from oks_k_sales_credits_v osc
                                   Where osc.chr_id = okh.id
                                   and osc.ctc_id = to_number(:p_ctr_rec_old_value)))
                         AND  okh.id = to_number(:update_level_value)';
Line: 757

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                        AND okh.id = to_number(:update_level_value)';
Line: 769

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                       AND okh.id = to_number(:update_level_value)';
Line: 782

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = to_number(:update_level_value)';
Line: 800

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                        AND okh.id = to_number(:update_level_value)';
Line: 812

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''BILLING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                       AND okh.id = to_number(:update_level_value)';
Line: 825

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = to_number(:update_level_value)';
Line: 842

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                        AND okh.id = to_number(:update_level_value)';
Line: 854

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                       AND okh.id = to_number(:update_level_value)';
Line: 867

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND  okh.id = to_number(:update_level_value)';
Line: 885

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                        AND okh.id = to_number(:update_level_value)';
Line: 897

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_BILLING''
                          and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                       AND okh.id = to_number(:update_level_value)';
Line: 910

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1 = :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND  okh.id = to_number(:update_level_value)';
Line: 928

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.start_hour is null
                                         and   oct.start_minute is null)
                        AND okh.id = to_number(:update_level_value)';
Line: 939

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND  okh.id = to_number(:update_level_value)';
Line: 955

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.end_hour is null
                                         and   oct.end_minute is null)
                        AND okh.id = to_number(:update_level_value)';
Line: 966

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.end_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND  okh.id = to_number(:update_level_value)';
Line: 982

             l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '|| l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                 OR mon_duration IS NULL
                                 OR tue_duration IS NULL
                                 OR wed_duration IS NULL
                                 OR thu_duration IS NULL
                                 OR fri_duration IS NULL
                                 OR sat_duration IS NULL)
                        AND okh.id = to_number(:update_level_value)';
Line: 1002

            l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND okh.id = to_number(:update_level_value)';
Line: 1026

                       l_stmt := l_select||', NULL old_value'||
                         l_from||', okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
                          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                               OR mon_duration IS NULL
                                               OR tue_duration IS NULL
                                               OR wed_duration IS NULL
                                               OR thu_duration IS NULL
                                               OR fri_duration IS NULL
                                               OR sat_duration IS NULL)
                        AND  okh.id = to_number(:update_level_value)';
Line: 1046

             l_stmt := l_select||' , :l_old_value old_value'||
                      l_from||', okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
                          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND  okh.id = to_number(:update_level_value)';
Line: 1072

              l_stmt := l_select||' ,NULL old_value'||
                        l_from||l_where||
                         ' AND  okh.price_list_id is NULL
                           AND  okh.id = to_number(:update_level_value) ';
Line: 1081

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                         l_from||l_where||
                         ' AND  okh.id = to_number(:update_level_value) ';
Line: 1088

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.price_list_id = to_number(:p_ctr_rec_old_value)
                         AND  okh.id = to_number(:update_level_value) ';
Line: 1102

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND okh.cognomen is null
                        AND okh.id = :update_level_value ' ;
Line: 1111

             l_stmt := l_select||' ,okh.cognomen old_value'||
                       l_from||l_where||
                       ' AND okh.id = :update_level_value ' ;
Line: 1119

             l_stmt := l_select||', okh.cognomen old_value'||
                       l_from||l_where||
                       '  AND okh.cognomen = :p_ctr_rec_old_value
                        AND okh.id = :update_level_value';
Line: 1133

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND okh.cust_po_number is null
                         AND ( okh.payment_instruction_type  Is Null Or okh.payment_instruction_type = ''PON'')
                        AND okh.id = :update_level_value ' ;
Line: 1143

             l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||l_where||
                       ' AND okh.payment_instruction_type = ''PON''
                         AND okh.id = :update_level_value And okh.cust_po_number_req_yn <> ''Y''' ;
Line: 1149

	                 l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||l_where||
                       ' AND okh.payment_instruction_type = ''PON''
                         AND okh.id = :update_level_value ' ;
Line: 1160

             l_stmt := l_select||', okh.cust_po_number old_value'||
                       l_from||l_where||
                       '  AND okh.cust_po_number = :p_ctr_rec_old_value
                          AND okh.payment_instruction_type = ''PON''
                        AND okh.id = :update_level_value And okh.cust_po_number_req_yn <>
			''Y''';
Line: 1168

	   l_stmt := l_select||', okh.cust_po_number old_value'||
                       l_from||l_where||
                       '  AND okh.cust_po_number = :p_ctr_rec_old_value
                          AND okh.payment_instruction_type = ''PON''
                        AND okh.id = :update_level_value';
Line: 1186

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       'AND okh.id = :update_level_value';
Line: 1193

             l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.renewal_po_required,''N'') = :p_ctr_rec_old_value
                                   AND okh.id = to_number(:update_level_value)';
Line: 1209

            l_stmt := l_select||' , :l_old_value old_value'||
                      l_from||' ,oks_k_headers_v oksh '||
                      l_where||' AND oksh.chr_id = okh.id
                                 AND okh.id = :update_level_value';
Line: 1217

              l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.inv_print_profile,''N'') = :p_ctr_rec_old_value
                                   AND okh.id = to_number(:update_level_value)';
Line: 1231

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id is NULL
     					          AND okh.id = to_number(:update_level_value)';
Line: 1249

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
                       AND okh.id = to_number(:update_level_value)';
Line: 1255

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id = to_number(:p_ctr_rec_old_value)
     					          AND okh.id = to_number(:update_level_value)';
Line: 1270

             l_stmt := l_select||',to_char(okh.start_date) old_value'||
                       l_from||
                       l_where||' AND okh.start_date is NULL
     					          AND okh.id = to_number(:update_level_value)';
Line: 1276

             l_stmt := l_select||',to_char(okh.start_date) old_value'||
                       l_from||
                       l_where||' AND trunc(okh.start_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
     					          AND okh.id = to_number(:update_level_value)';
Line: 1288

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND okh.end_date is NULL
     					          AND okh.id = to_number(:update_level_value)';
Line: 1294

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND trunc(okh.end_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
     					          AND okh.id = to_number(:update_level_value)';
Line: 1306

 ELSIF p_ctr_rec.update_level = 'OKX_OPERUNIT' THEN --'ORGANIZATION' THEN


 ---------------------------------------------------------
 --  Update Level : Organization , Attribute: Revenue Account (REV_ACCT)
 --------------------------------------------------------
      IF p_ctr_rec.attribute = 'REV_ACCT' THEN

       -- Old Value: NULL (-9999)
	     IF p_ctr_rec.old_value = '-9999' THEN   -- For old Value as NULL
             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id is NULL)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1327

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1338

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id  = to_number(:p_ctr_rec_old_value))
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1357

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                       ' AND  okh.PAYMENT_TERM_ID is NULL
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1363

                       l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                               'AND okh.org_id = to_number(:update_level_value)';
Line: 1370

             l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.payment_term_id = to_number(:p_ctr_rec_old_value)
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1385

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||
                       l_where||
                       ' AND  okh.renewal_type_code is NULL
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1405

                       l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where||
                             ' AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                                AND okh.org_id = to_number(:update_level_value)';
Line: 1427

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND  okh.renewal_type_code = ''NSR''
                        AND ''ERN'' = :p_ctr_rec_old_value
                        AND oksh.ELECTRONIC_RENEWAL_FLAG =''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1452

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND  okh.renewal_type_code = :p_ctr_rec_old_value
                        AND   nvl(oksh.ELECTRONIC_RENEWAL_FLAG,''N'') <> ''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1480

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||
                        l_where|| 'AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21)
                                            AND cln.price_list_id is NULL)
                                   AND okh.org_id = to_number(:update_level_value)';
Line: 1491

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21))
                                   AND okh.org_id = to_number(:update_level_value)';
Line: 1501

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                      Where cln.dnz_chr_id = okh.id
                                      AND cln.lse_id in(3,16,21)
                                      AND cln.price_list_id = to_number(:p_ctr_rec_old_value))
                                  AND okh.org_id = to_number(:update_level_value)';
Line: 1521

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where|| 'AND oksh.chr_id = okh.id
                                   AND oksh.acct_rule_id IS NULL
                                   AND okh.org_id = to_number(:update_level_value)';
Line: 1529

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND okh.org_id = to_number(:update_level_value)';
Line: 1536

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND oksh.acct_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND okh.org_id = to_number(:update_level_value)';
Line: 1552

             l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                             ' AND  okh.inv_rule_id IS NULL
                               AND  okh.org_id = to_number(:update_level_value)';
Line: 1558

             l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                       l_from||l_where||
                             ' AND  okh.org_id = to_number(:update_level_value)';
Line: 1565

             l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                       l_from||l_where||
                             ' AND  okh.inv_rule_id = to_number(:p_ctr_rec_old_value)
                               AND  okh.org_id = to_number(:update_level_value)';
Line: 1578

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V okl, oks_k_lines_v oksl
                                             WHERE okl.dnz_chr_id = okh.id
                                             AND oksl.cle_id = okl.id
                                             AND oksl.coverage_type is NULL )
                        AND  okh.org_id = to_number(:update_level_value)';
Line: 1591

                l_stmt := l_select||' , :l_old_value old_value'||
                          l_from||
                          l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                    WHERE okl.dnz_chr_id = okh.id
                                    AND oksl.cle_id = okl.id )
                        AND  okh.org_id = to_number(:update_level_value)';
Line: 1600

                 l_stmt := l_select||' , :l_old_value old_value'||
                           l_from||
                           l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                     WHERE okl.dnz_chr_id = okh.id
                                     AND oksl.cle_id = okl.id
                                     AND oksl.coverage_type = :p_ctr_rec_old_value )
                         AND  okh.org_id = to_number(:update_level_value)';
Line: 1618

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                      WHERE ctz.dnz_chr_id = okh.id
                                      AND   ctz.timezone_id IS NULL )
                         AND  okh.org_id = to_number(:update_level_value)';
Line: 1629

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND   ctz.timezone_id IS NOT NULL )
                                             AND  okh.org_id = to_number(:update_level_value)';
Line: 1639

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND  ctz.timezone_id = to_number(:p_ctr_rec_old_value))
                                             AND  okh.org_id = to_number(:update_level_value)';
Line: 1657

                l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE'')
                                             AND   okh.org_id = to_number(:update_level_value)';
Line: 1670

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND   okh.org_id = to_number(:update_level_value)';
Line: 1689

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP'')
                                             AND   okh.org_id = to_number(:update_level_value)';
Line: 1702

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND   okh.org_id = to_number(:update_level_value)';
Line: 1722

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from okc_governances_v ogv
                                             WHERE ogv.dnz_chr_id = okh.id
                                             AND   ogv.isa_agreement_id = :p_ctr_rec_old_value)
                                             AND   okh.org_id = to_number(:update_level_value)';
Line: 1736

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen is NULL)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1748

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35))
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1760

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1777

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen is NULL)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1788

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19))
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1800

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1817

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                ' AND  okh.ship_to_site_use_id is NULL
                                  AND okh.org_id = to_number(:update_level_value)';
Line: 1825

                 l_stmt := l_select||' ,okh.ship_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.ship_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND okh.org_id = to_number(:update_level_value)';
Line: 1838

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id is NULL
                                     AND okh.org_id = to_number(:update_level_value)';
Line: 1845

                 l_stmt := l_select||' ,okh.bill_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND okh.org_id = to_number(:update_level_value)';
Line: 1857

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1868

             l_stmt := l_select||' ,oc.object1_id1 old_value '||
                       l_from||', okc_contacts oc '||
                       l_where||' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SALESPERSON''
                          and   oc.jtot_object1_code = ''OKX_SALEPERS''
                       AND okh.org_id = to_number(:update_level_value)';
Line: 1877

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND (EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                        OR EXISTS (Select ''x'' from oks_k_sales_credits_v osc
                                   Where osc.chr_id = okh.id
                                   and osc.ctc_id = to_number(:p_ctr_rec_old_value)))
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1897

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1907

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                       AND okh.org_id = to_number(:update_level_value)';
Line: 1918

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1935

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1945

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''BILLING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                       AND okh.org_id = to_number(:update_level_value)';
Line: 1956

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.org_id = to_number(:update_level_value)';
Line: 1973

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                        AND okh.org_id = to_number(:update_level_value)';
Line: 1983

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                       AND okh.org_id = to_number(:update_level_value)';
Line: 1994

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND okh.org_id = to_number(:update_level_value)';
Line: 2011

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                        AND okh.org_id = to_number(:update_level_value)';
Line: 2021

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_BILLING''
                          and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                       AND okh.org_id = to_number(:update_level_value)';
Line: 2032

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND okh.org_id = to_number(:update_level_value)';
Line: 2051

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.start_hour is null
                                         and   oct.start_minute is null)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 2062

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND okh.org_id = to_number(:update_level_value)';
Line: 2078

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.end_hour is null
                                         and   oct.end_minute is null)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 2088

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.end_minute = mod(to_number(:p_ctr_rec_old_value),60))
                        AND okh.org_id = to_number(:update_level_value)';
Line: 2104

             l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '|| l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                 OR mon_duration IS NULL
                                 OR tue_duration IS NULL
                                 OR wed_duration IS NULL
                                 OR thu_duration IS NULL
                                 OR fri_duration IS NULL
                                 OR sat_duration IS NULL)
                        AND okh.authoring_org_id = to_number(:update_level_value)';
Line: 2126

            l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND okh.authoring_org_id = to_number(:update_level_value)';
Line: 2150

                       l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
		          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                               OR mon_duration IS NULL
                                               OR tue_duration IS NULL
                                               OR wed_duration IS NULL
                                               OR thu_duration IS NULL
                                               OR fri_duration IS NULL
                                               OR sat_duration IS NULL)
                        AND okh.authoring_org_id = to_number(:update_level_value)';
Line: 2170

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
		          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND okh.authoring_org_id = to_number(:update_level_value)';
Line: 2196

              l_stmt := l_select||' ,NULL old_value'||
                        l_from||l_where||
                         ' AND  okh.price_list_id is NULL
                           AND okh.org_id = to_number(:update_level_value)';
Line: 2204

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                         l_from||l_where||
                         ' AND okh.org_id = to_number(:update_level_value)';
Line: 2212

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.price_list_id = to_number(:p_ctr_rec_old_value)
                         AND okh.org_id = to_number(:update_level_value)';
Line: 2225

             l_stmt := l_select||' ,NULL old_value '||
                       l_from||l_where||
                       'AND okh.cognomen IS NULL
     					AND okh.org_id = to_number(:update_level_value)';
Line: 2231

             l_stmt := l_select||' ,okh.cognomen old_value'||
                       l_from||
                       l_where||' AND okh.org_id = to_number(:update_level_value)';
Line: 2236

             l_stmt := l_select||', okh.cognomen old_value'||
                       l_from||
                       l_where||' AND okh.cognomen = :p_ctr_rec_old_value
     			        AND okh.org_id = to_number(:update_level_value)';
Line: 2248

             l_stmt := l_select||' ,NULL old_value '||
                       l_from||l_where||
                       'AND okh.cust_po_number IS NULL
                        AND ( okh.payment_instruction_type  Is Null Or okh.payment_instruction_type = ''PON'')
     					AND okh.org_id = to_number(:update_level_value)';
Line: 2256

                       l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||' AND okh.org_id = to_number(:update_level_value) AND okh.payment_instruction_type = ''PON''
                                 and okh.cust_po_number_req_yn <> ''Y''';
Line: 2262

	              l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||' AND okh.payment_instruction_type = ''PON'' AND okh.org_id = to_number(:update_level_value)';
Line: 2268

             l_stmt := l_select||', okh.cust_po_number old_value'||
                       l_from||
                       l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value
     					          AND okh.payment_instruction_type = ''PON'' AND okh.org_id = to_number(:update_level_value) and okh.cust_po_number_req_yn <> ''Y''';
Line: 2273

             l_stmt := l_select||', okh.cust_po_number old_value'||
                       l_from||
                       l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value
     					         AND okh.payment_instruction_type = ''PON''  AND okh.org_id = to_number(:update_level_value)';
Line: 2295

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       'AND okh.org_id = to_number(:update_level_value)';
Line: 2303

             l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.renewal_po_required,''N'') = :p_ctr_rec_old_value
                          AND okh.org_id = to_number(:update_level_value)';
Line: 2319

            l_stmt := l_select||'  , :l_old_value old_value'||
                      l_from||' ,oks_k_headers_v oksh '||
                      l_where||' AND oksh.chr_id = okh.id
                                 AND okh.org_id = to_number(:update_level_value)';
Line: 2329

              l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.inv_print_profile,''N'') = :p_ctr_rec_old_value
                                   AND okh.org_id = to_number(:update_level_value)';
Line: 2345

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id is NULL
     					          AND okh.org_id = to_number(:update_level_value)';
Line: 2353

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okh.org_id = to_number(:update_level_value)';
Line: 2359

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id = to_number(:p_ctr_rec_old_value)
     					          AND okh.org_id = to_number(:update_level_value)';
Line: 2372

             l_stmt:= l_select||',to_char(okh.start_date) old_value '||
                      l_from||
                      l_where||' AND okh.start_date is NULL
                                 AND okh.org_id = to_number(:update_level_value)';
Line: 2378

             l_stmt:= l_select||',to_char(okh.start_date) old_value '||
                      l_from||
                      l_where||' AND trunc(okh.start_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
                                 AND okh.org_id = to_number(:update_level_value)';
Line: 2390

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND okh.end_date is NULL
						          AND okh.org_id = to_number(:update_level_value)';
Line: 2396

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND trunc(okh.end_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
						          AND okh.org_id = to_number(:update_level_value)';
Line: 2407

 ELSIF p_ctr_rec.update_level = 'OKX_PARTY' THEN

 --------------------------------------------------------
 --  Update Level : Party , Attribute: Revenue Account(REV_ACCT)
 --------------------------------------------------------
      IF p_ctr_rec.attribute = 'REV_ACCT' THEN

	     IF p_ctr_rec.old_value = '-9999' THEN   -- For old Value as NULL
             l_stmt := l_select||' ,NULL old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id is NULL)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in ( ''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2426

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in ( ''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2438

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||
                       l_where||' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id = to_number(:p_ctr_rec_old_value))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2458

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from|| ' ,okc_k_party_roles_b okp1 '||
                       l_where||' AND  okh.PAYMENT_TERM_ID is NULL
                                  AND  okh.id = okp1.chr_id
                                  AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND  okp1.object1_id1 = :update_level_value ' ;
Line: 2466

                       l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1 '||
                       l_where||'AND  okh.id = okp1.chr_id
                                 AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                 AND  okp1.object1_id1 = :update_level_value ' ;
Line: 2475

             l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1 '||
                       l_where|| ' AND  okh.payment_term_id = to_number(:p_ctr_rec_old_value)
                                   AND  okh.id = okp1.chr_id
                                   AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                   AND  okp1.object1_id1 = :update_level_value ' ;
Line: 2492

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1 '||
                       l_where||
                       ' AND  okh.renewal_type_code is NULL
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value ' ;
Line: 2514

                       l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1 '||
                       l_where|| 'AND  okh.id = okp1.chr_id
                                  AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                                  AND  okp1.object1_id1 = :update_level_value ' ;
Line: 2536

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh ,okc_k_party_roles_b okp1'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND  okh.renewal_type_code = ''NSR''
                        AND ''ERN'' = :p_ctr_rec_old_value
                        AND oksh.ELECTRONIC_RENEWAL_FLAG =''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value ' ;
Line: 2563

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh ,okc_k_party_roles_b okp1'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND  okh.renewal_type_code = :p_ctr_rec_old_value
                        AND nvl(oksh.ELECTRONIC_RENEWAL_FLAG,''N'') <> ''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value ' ;
Line: 2594

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||' ,okc_k_party_roles_b okp1  '||
                        l_where|| 'AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21)
                                            AND cln.price_list_id is NULL)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value ';
Line: 2607

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1  '||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value ';
Line: 2619

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1 '||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                      Where cln.dnz_chr_id = okh.id
                                      AND cln.lse_id in(3,16,21)
                                      AND cln.price_list_id = to_number(:p_ctr_rec_old_value))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value ';
Line: 2640

              l_stmt := l_select||' ,NULL old_value' ||
                       l_from||' ,oks_k_headers_v oksh ,okc_k_party_roles_b okp1 '||
                        l_where|| 'AND oksh.chr_id = okh.id
                                   AND oksh.acct_rule_id IS NULL
                                   AND  okh.id = okp1.chr_id
                                   AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                   AND  okp1.object1_id1 = :update_level_value';
Line: 2650

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh ,okc_k_party_roles_b okp1 '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND  okh.id = okp1.chr_id
                                  AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND  okp1.object1_id1 = :update_level_value';
Line: 2659

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh ,okc_k_party_roles_b okp1 '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND oksh.acct_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND  okh.id = okp1.chr_id
                                  AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND  okp1.object1_id1 = :update_level_value';
Line: 2677

             l_stmt := l_select||' ,NULL old_value' ||
                       l_from||',okc_k_party_roles_b okp1 '||
                       l_where||
                             ' AND  okh.inv_rule_id IS NULL
                               AND  okh.id = okp1.chr_id
                               AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                               AND  okp1.object1_id1 = :update_level_value';
Line: 2686

             l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1 '||
                       l_where||
                             ' AND  okh.id = okp1.chr_id
                               AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                               AND  okp1.object1_id1 = :update_level_value';
Line: 2696

             l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                       l_from||',okc_k_party_roles_b okp1 '||
                       l_where||
                             ' AND  okh.inv_rule_id = to_number(:p_ctr_rec_old_value)
                               AND  okh.id = okp1.chr_id
                               AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                               AND  okp1.object1_id1 = :update_level_value';
Line: 2713

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V okl, oks_k_lines_v oksl
                                             WHERE okl.dnz_chr_id = okh.id
                                             AND oksl.cle_id = okl.id
                                             AND oksl.coverage_type is NULL )
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2728

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                 WHERE okl.dnz_chr_id = okh.id
                                 AND oksl.cle_id      = okl.id )
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2740

              l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||',okc_k_party_roles_v okp1'||
                        l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                  WHERE okl.dnz_chr_id   = okh.id
                                  AND oksl.cle_id        = okl.id
                                  AND oksl.coverage_type = :p_ctr_rec_old_value )
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2760

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||
                       ' AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                      WHERE ctz.dnz_chr_id = okh.id
                                      AND   ctz.timezone_id IS NULL )
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2774

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND   ctz.timezone_id IS NOT NULL )
                          AND  okh.id = okp1.chr_id
                          AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                          AND  okp1.object1_id1 = :update_level_value';
Line: 2786

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND  ctz.timezone_id = to_number(:p_ctr_rec_old_value))
                          AND  okh.id = okp1.chr_id
                          AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                          AND  okp1.object1_id1 = :update_level_value';
Line: 2804

                l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE'')
                                             AND  okh.id = okp1.chr_id
                                             AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                             AND  okp1.object1_id1 = :update_level_value';
Line: 2820

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND  okh.id = okp1.chr_id
                                             AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                             AND  okp1.object1_id1 = :update_level_value';
Line: 2842

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP'')
                                             AND   okh.id = okp1.chr_id
                                             AND   okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                             AND   okp1.object1_id1 = :update_level_value';
Line: 2858

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP''
                                             AND   oco.object1_id1  =  :p_ctr_rec_old_value)
                                             AND   okh.id = okp1.chr_id
                                             AND   okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                             AND   okp1.object1_id1 = :update_level_value';
Line: 2879

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_v okp1'||
                       l_where||'AND EXISTS (SELECT ''x'' from okc_governances_v ogv
                                             WHERE ogv.dnz_chr_id = okh.id
                                             AND   ogv.isa_agreement_id = :p_ctr_rec_old_value)
                                             AND   okh.id = okp1.chr_id
                                             AND   okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                             AND   okp1.object1_id1 = :update_level_value';
Line: 2894

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id in (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen is NULL)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2906

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id in (7,8,9,10,11,18,25,35))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2918

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id in (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2936

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id in (1,12,14,19)
                                     AND   cle.cognomen is NULL)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2948

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id in (1,12,14,19))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2960

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||' ,okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id in (1,12,14,19)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 2979

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||',okc_k_party_roles_b okp1'||
                           l_where||' AND  okh.ship_to_site_use_id is NULL
                                  AND  okh.id = okp1.chr_id
                                  AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND  okp1.object1_id1 = :update_level_value';
Line: 2989

                 l_stmt := l_select||' ,okh.ship_to_site_use_id old_value' ||
                           l_from||',okc_k_party_roles_b okp1'||
                           l_where||' AND  okh.ship_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND  okh.id = okp1.chr_id
                                     AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                     AND  okp1.object1_id1 = :update_level_value';
Line: 3006

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||',okc_k_party_roles_b okp1'||
                           l_where||
                                   ' AND  okh.bill_to_site_use_id is NULL
                                     AND  okh.id = okp1.chr_id
                                     AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                     AND  okp1.object1_id1 = :update_level_value';
Line: 3016

                 l_stmt := l_select||' ,okh.bill_to_site_use_id old_value' ||
                           l_from||',okc_k_party_roles_b okp1'||
                           l_where||
                                   ' AND  okh.bill_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND  okh.id = okp1.chr_id
                                     AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                     AND  okp1.object1_id1 = :update_level_value';
Line: 3032

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3044

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||',okc_k_party_roles_b okp1, okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SALESPERSON''
                          and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3056

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND (EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                        OR EXISTS (Select ''x'' from oks_k_sales_credits_v osc
                                   Where osc.chr_id = okh.id
                                   and osc.ctc_id = to_number(:p_ctr_rec_old_value)))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3076

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3088

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||',okc_k_party_roles_b okp1, okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3101

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3119

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3131

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||',okc_k_party_roles_b okp1, okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''BILLING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3144

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3163

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3175

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||',okc_k_party_roles_b okp1, okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3188

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3206

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3218

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||',okc_k_party_roles_b okp1, okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_BILLING''
                          and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3231

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3253

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                         where igs.dnz_chr_id = okh.id
                                         and   igs.start_hour is null
                                         and   igs.start_minute is null)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code = ''CUSTOMER''
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3267

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                      where igs.dnz_chr_id = okh.id
                                      and   igs.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                      AND   igs.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in = ''CUSTOMER''
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3282

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||
                       l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.start_hour is null
                                         and   oct.start_minute is null)
                        AND okh.org_id = to_number(:update_level_value)';
Line: 3294

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||
                       l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3315

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                         where igs.dnz_chr_id = okh.id
                                         and     igs.end_hour is null
                                         and   igs.end_minute is null)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code = ''CUSTOMER''
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3329

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                      where igs.dnz_chr_id = okh.id
                                      and  igs.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                      AND   igs.end_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code = ''CUSTOMER''
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3343

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||
                       l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.end_hour is null
                                         and   oct.end_minute is null)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3356

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_party_roles_b okp1 '||
                       l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.end_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3375

             l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat,okc_k_party_roles_b okp1 '|| l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                 OR mon_duration IS NULL
                                 OR tue_duration IS NULL
                                 OR wed_duration IS NULL
                                 OR thu_duration IS NULL
                                 OR fri_duration IS NULL
                                 OR sat_duration IS NULL)
                         AND  okp1.dnz_chr_id = okh.id  And okp1.cle_id Is Null
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3398

            l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat,okc_k_party_roles_b okp1 '||l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                         AND  okp1.dnz_chr_id = okh.id  And okp1.cle_id Is Null
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3424

                       l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat,okc_k_party_roles_b okp1 '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
		          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                               OR mon_duration IS NULL
                                               OR tue_duration IS NULL
                                               OR wed_duration IS NULL
                                               OR thu_duration IS NULL
                                               OR fri_duration IS NULL
                                               OR sat_duration IS NULL)
                        AND  okp1.dnz_chr_id = okh.id  And okp1.cle_id Is Null
                        AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                        AND  okp1.object1_id1 = :update_level_value';
Line: 3446

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat,okc_k_party_roles_b okp1 '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
		          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND  okp1.dnz_chr_id = okh.id  And okp1.cle_id Is Null
                        AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                        AND  okp1.object1_id1 = :update_level_value';
Line: 3474

              l_stmt := l_select||' ,NULL old_value'||
                        l_from||' ,okc_k_party_roles_b okp1'||
                        l_where||
                         ' AND  okh.price_list_id is NULL
                           AND  okh.id = okp1.chr_id
                           AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                           AND  okp1.object1_id1 = :update_level_value';
Line: 3486

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1'||
                       l_where||
                         ' AND  okh.id = okp1.chr_id
                           AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                           AND  okp1.object1_id1 = :update_level_value';
Line: 3498

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                       l_from||' ,okc_k_party_roles_b okp1'||
                       l_where||
                       ' AND  okh.price_list_id = to_number(:p_ctr_rec_old_value)
                         AND  okh.id = okp1.chr_id
                         AND  okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                         AND  okp1.object1_id1 = :update_level_value';
Line: 3514

             l_stmt := l_select||' ,NULL old_value '||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||'AND okh.cognomen IS NULL
                                 AND okh.id = okp1.chr_id
                                 AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                 AND okp1.object1_id1 = :update_level_value';
Line: 3523

             l_stmt := l_select||' ,okh.cognomen old_value'||
                       l_from||', okc_k_party_roles_b okp1 '||
                       l_where||' AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3530

             l_stmt := l_select||', okh.cognomen  old_value'||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||' AND okh.cognomen = :p_ctr_rec_old_value
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3544

             l_stmt := l_select||' ,NULL old_value '||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||'AND okh.cust_po_number IS NULL
                                 AND okh.id = okp1.chr_id
                                 AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                 AND ( okh.payment_instruction_type  Is Null Or okh.payment_instruction_type = ''PON'')
                                 AND okp1.object1_id1 = :update_level_value';
Line: 3554

                l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||', okc_k_party_roles_b okp1 '||
                       l_where||' AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okh.payment_instruction_type = ''PON''
                                  AND okp1.object1_id1 = :update_level_value and okh.cust_po_number_req_yn <> ''Y''';
Line: 3561

                l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||', okc_k_party_roles_b okp1 '||
                       l_where||' AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okh.payment_instruction_type = ''PON''
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3577

                l_stmt := l_select||', okh.cust_po_number old_value'||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okh.payment_instruction_type = ''PON''
                                  AND okp1.object1_id1 = :update_level_value and okh.cust_po_number_req_yn <> ''Y''';
Line: 3586

                l_stmt := l_select||', okh.cust_po_number old_value'||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okh.payment_instruction_type = ''PON''
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3609

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||'AND okh.id = okp1.chr_id
                                AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                AND okp1.object1_id1 = :update_level_value';
Line: 3619

             l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||', okc_k_party_roles_b okp1 ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.renewal_po_required,''N'') = :p_ctr_rec_old_value
                                   AND okh.id = okp1.chr_id
                                   AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                   AND okp1.object1_id1 = :update_level_value';
Line: 3637

            l_stmt := l_select||' , :l_old_value old_value'||
                      l_from||', okc_k_party_roles_b okp1 ,oks_k_headers_v oksh '||
                      l_where||' AND oksh.chr_id = okh.id
                                 AND okh.id = okp1.chr_id
                                 AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                 AND okp1.object1_id1 = :update_level_value';
Line: 3649

              l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||', okc_k_party_roles_b okp1 ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.inv_print_profile,''N'') = :p_ctr_rec_old_value
                                   AND okh.id = okp1.chr_id
                                   AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                   AND okp1.object1_id1 = :update_level_value';
Line: 3665

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg, okc_k_party_roles_b okp1'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id is NULL
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3673

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||',okc_k_party_roles_b okp1'||
                       l_where||' AND EXISTS (SELECT id from okc_k_headers_v a
                                    WHERE a.id = okh.id
                                    MINUS
                                    SELECT okg.included_chr_id
                                    FROM okc_k_groups_grpings_v okg
									WHERE okg.included_chr_id = okh.id)
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code = ''CUSTOMER''
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3687

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg, okc_k_party_roles_b okp1'||
                       l_where||' AND okg.included_chr_id = okh.id
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3695

             l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg, okc_k_party_roles_b okp1'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id = to_number(:p_ctr_rec_old_value)
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3710

             l_stmt:= l_select||',to_char(okh.start_date) old_value '||
                      l_from||', okc_k_party_roles_b okp1'||
                      l_where||' AND okh.start_date is NULL
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3717

             l_stmt:= l_select||',to_char(okh.start_date) old_value '||
                      l_from||', okc_k_party_roles_b okp1'||
                      l_where||'  AND trunc(okh.start_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3731

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||' AND okh.end_date is NULL
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3739

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||', okc_k_party_roles_b okp1'||
                       l_where||' AND trunc(okh.end_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
                                  AND okh.id = okp1.chr_id
                                  AND okp1.rle_code in (''CUSTOMER'',''SUBSCRIBER'')
                                  AND okp1.object1_id1 = :update_level_value';
Line: 3752

 ELSIF p_ctr_rec.update_level = 'OKS_K_CATEGORY' THEN


---------------------------------------------------------------------
 --  Update Level : Category , Attribute: Revenue Account(REV_ACCT)
 ---------------------------------------------------------------------
      IF p_ctr_rec.attribute = 'REV_ACCT' THEN

	     IF p_ctr_rec.old_value = '-9999' THEN   -- For old Value as NULL
             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id is NULL)
                        AND  okh.scs_code = :update_level_value';
Line: 3770

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id)
                        AND  okh.scs_code = :update_level_value';
Line: 3778

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id = to_number(:p_ctr_rec_old_value))
                        AND  okh.scs_code = :update_level_value';
Line: 3794

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                       ' AND  okh.PAYMENT_TERM_ID is NULL
                         AND  okh.scs_code = :update_level_value';
Line: 3802

                       l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                               'AND  okh.scs_code = :update_level_value';
Line: 3809

             l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.payment_term_id = to_number(:p_ctr_rec_old_value)
                         AND  okh.scs_code = :update_level_value';
Line: 3824

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||
                       l_where||
                       ' AND  okh.renewal_type_code is NULL
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.scs_code = :update_level_value';
Line: 3844

                       l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where||
                              ' AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                                AND  okh.scs_code = :update_level_value';
Line: 3865

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                         AND okh.renewal_type_code = ''NSR''
                         AND ''ERN'' = :p_ctr_rec_old_value
                         AND oksh.ELECTRONIC_RENEWAL_FLAG = ''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.scs_code = :update_level_value';
Line: 3890

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                         AND okh.renewal_type_code = :p_ctr_rec_old_value
                         AND nvl(oksh.ELECTRONIC_RENEWAL_FLAG,''N'') <> ''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.scs_code = :update_level_value';
Line: 3918

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||
                        l_where|| 'AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21)
                                            AND cln.price_list_id is NULL)
                                   AND okh.scs_code = :update_level_value';
Line: 3929

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21))
                                   AND  okh.scs_code = :update_level_value';
Line: 3939

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                      Where cln.dnz_chr_id = okh.id
                                      AND cln.lse_id in(3,16,21)
                                      AND cln.price_list_id = to_number(:p_ctr_rec_old_value))
                                  AND  okh.scs_code = :update_level_value';
Line: 3958

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where|| 'AND oksh.chr_id = okh.id
                                   AND oksh.acct_rule_id IS NULL
                                   AND okh.scs_code = :update_level_value';
Line: 3966

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND okh.scs_code = :update_level_value';
Line: 3973

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND oksh.acct_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND okh.scs_code = :update_level_value';
Line: 3990

             l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                             ' AND  okh.inv_rule_id IS NULL
                               AND  okh.scs_code = :update_level_value';
Line: 3997

                    l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                              l_from||l_where||
                                    ' AND  okh.scs_code = :update_level_value';
Line: 4006

                l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                          l_from||l_where||
                                ' AND  okh.inv_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND  okh.scs_code = :update_level_value';
Line: 4020

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V okl, oks_k_lines_v oksl
                                             WHERE okl.dnz_chr_id = okh.id
                                             AND oksl.cle_id = okl.id
                                             AND oksl.coverage_type is NULL )
                                             AND  okh.scs_code = :update_level_value';
Line: 4033

                l_stmt := l_select||' , :l_old_value old_value'||
                          l_from||
                          l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                    WHERE okl.dnz_chr_id = okh.id
                                    AND oksl.cle_id = okl.id )
                                    AND  okh.scs_code = :update_level_value';
Line: 4042

                 l_stmt := l_select||' , :l_old_value old_value'||
                           l_from||
                           l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                     WHERE okl.dnz_chr_id = okh.id
                                     AND oksl.cle_id = okl.id
                                     AND oksl.coverage_type = :p_ctr_rec_old_value )
                                     AND  okh.scs_code = :update_level_value';
Line: 4059

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                      WHERE ctz.dnz_chr_id = okh.id
                                      AND   ctz.timezone_id IS NULL )
                         AND  okh.scs_code = :update_level_value' ;
Line: 4070

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND   ctz.timezone_id IS NOT NULL )
                                             AND  okh.scs_code = :update_level_value' ;
Line: 4080

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND  ctz.timezone_id = to_number(:p_ctr_rec_old_value))
                                             AND  okh.scs_code = :update_level_value' ;
Line: 4096

                l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE'')
                                 AND  okh.scs_code = :update_level_value';
Line: 4107

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                 AND   okh.scs_code = :update_level_value';
Line: 4125

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP'')
                                             AND  okh.scs_code = :update_level_value';
Line: 4136

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND  okh.scs_code = :update_level_value';
Line: 4154

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from okc_governances_v ogv
                                             WHERE ogv.dnz_chr_id = okh.id
                                             AND   ogv.isa_agreement_id = :p_ctr_rec_old_value)
                                             AND   okh.scs_code=:update_level_value';
Line: 4167

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen is NULL)
                        AND  okh.scs_code = :update_level_value';
Line: 4176

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35))
                        AND  okh.scs_code = :update_level_value';
Line: 4185

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                        AND  okh.scs_code = :update_level_value';
Line: 4201

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen is NULL)
                        AND  okh.scs_code = :update_level_value';
Line: 4211

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19))
                        AND  okh.scs_code = :update_level_value';
Line: 4219

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                        AND  okh.scs_code = :update_level_value';
Line: 4236

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                ' AND  okh.ship_to_site_use_id is NULL
                                  AND  okh.scs_code = :update_level_value';
Line: 4244

                 l_stmt := l_select||' ,okh.ship_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.ship_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND  okh.scs_code = :update_level_value';
Line: 4258

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id is NULL
                                     AND  okh.scs_code = :update_level_value';
Line: 4265

                 l_stmt := l_select||' ,okh.bill_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND  okh.scs_code = :update_level_value';
Line: 4277

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                        AND  okh.scs_code = :update_level_value';
Line: 4287

             l_stmt := l_select||' ,oc.object1_id1 old_value '||
                       l_from||', okc_contacts oc '||
                       l_where||' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SALESPERSON''
                          and   oc.jtot_object1_code = ''OKX_SALEPERS''
                       AND  okh.scs_code = :update_level_value';
Line: 4296

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND (EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                         OR EXISTS (Select ''x'' from oks_k_sales_credits_v osc
                                   Where osc.chr_id = okh.id
                                   and osc.ctc_id = to_number(:p_ctr_rec_old_value)))
                         AND  okh.scs_code = :update_level_value';
Line: 4316

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                        AND  okh.scs_code = :update_level_value';
Line: 4326

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                       AND  okh.scs_code = :update_level_value';
Line: 4338

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.scs_code = :update_level_value';
Line: 4355

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                        AND  okh.scs_code = :update_level_value';
Line: 4365

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''BILLING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                       AND  okh.scs_code = :update_level_value';
Line: 4376

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND  okh.scs_code = :update_level_value';
Line: 4393

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                        AND  okh.scs_code = :update_level_value';
Line: 4403

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                       AND  okh.scs_code = :update_level_value';
Line: 4415

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND  okh.scs_code = :update_level_value';
Line: 4432

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                        AND  okh.scs_code= = :update_level_value';
Line: 4442

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_BILLING''
                          and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                       AND  okh.scs_code = :update_level_value';
Line: 4453

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1= :p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND  okh.scs_code = :update_level_value';
Line: 4471

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                         where igs.dnz_chr_id = okh.id
                                         and   ((igs.start_hour is null
                                         and   igs.start_minute is null)
                                         OR
                                         (     igs.end_hour is null
                                         and   igs.end_minute is null))
                        AND  okh.scs_code = :update_level_value';
Line: 4485

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                      where igs.dnz_chr_id = okh.id
                                      and  (( igs.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                      AND   igs.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                                      OR
                                      ( igs.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                      AND   igs.end_minute = mod(to_number(:p_ctr_rec_old_value),60)))
                         AND  okh.scs_code = :update_level_value';
Line: 4505

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.start_hour is null
                                         and   oct.start_minute is null)
                        AND  okh.scs_code = :update_level_value';
Line: 4516

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND  okh.scs_code = :update_level_value';
Line: 4532

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.end_hour is null
                                         and   oct.end_minute is null)
                        AND  okh.scs_code = :update_level_value';
Line: 4542

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.end_minute = mod(to_number(:p_ctr_rec_old_value),60))
                        AND  okh.scs_code = :update_level_value';
Line: 4558

             l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '|| l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                 OR mon_duration IS NULL
                                 OR tue_duration IS NULL
                                 OR wed_duration IS NULL
                                 OR thu_duration IS NULL
                                 OR fri_duration IS NULL
                                 OR sat_duration IS NULL)

                        AND  okh.scs_code = :update_level_value';
Line: 4579

            l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND  okh.scs_code = :update_level_value';
Line: 4603

                       l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
		          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                               OR mon_duration IS NULL
                                               OR tue_duration IS NULL
                                               OR wed_duration IS NULL
                                               OR thu_duration IS NULL
                                               OR fri_duration IS NULL
                                               OR sat_duration IS NULL)
                        AND  okh.scs_code = :update_level_value';
Line: 4621

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
		          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND  okh.scs_code = :update_level_value';
Line: 4647

              l_stmt := l_select||' ,NULL old_value'||
                        l_from||l_where||
                         ' AND  okh.price_list_id is NULL
                           AND okh.scs_code = :update_level_value';
Line: 4655

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                         l_from||l_where||
                         ' AND okh.scs_code = :update_level_value';
Line: 4662

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.price_list_id = to_number(:p_ctr_rec_old_value)
                         AND okh.scs_code = :update_level_value';
Line: 4677

             l_stmt := l_select||' ,NULL old_value '||
                       l_from||
                       l_where||'AND okh.cognomen IS NULL
                                 AND okh.scs_code = :update_level_value';
Line: 4684

             l_stmt := l_select||' ,okh.cognomen old_value'||
                       l_from||
                       l_where||' AND okh.scs_code = :update_level_value';
Line: 4689

             l_stmt := l_select||' ,okh.cognomen old_value'||
                       l_from||
                       l_where||' AND okh.cognomen = :p_ctr_rec_old_value
                                  AND okh.scs_code = :update_level_value';
Line: 4702

             l_stmt := l_select||' ,NULL old_value '||
                       l_from||
                       l_where||'AND okh.cust_po_number IS NULL
                                 AND ( okh.payment_instruction_type  Is Null Or okh.payment_instruction_type = ''PON'')
                                 AND okh.scs_code = :update_level_value';
Line: 4710

             l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||' AND okh.payment_instruction_type = ''PON'' AND okh.scs_code = :update_level_value and okh.cust_po_number_req_yn <> ''Y''';
Line: 4715

	                l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||'AND okh.payment_instruction_type = ''PON'' AND okh.scs_code = :update_level_value ';
Line: 4723

             l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value
                                  AND okh.payment_instruction_type = ''PON''
                                  AND okh.scs_code = :update_level_value and okh.cust_po_number_req_yn <> ''Y''';
Line: 4730

             l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value AND okh.payment_instruction_type = ''PON''
                                 AND okh.scs_code = :update_level_value ';
Line: 4746

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||
                       'AND okh.scs_code = :update_level_value';
Line: 4755

             l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.renewal_po_required,''N'') = :p_ctr_rec_old_value
                                   AND okh.scs_code = :update_level_value';
Line: 4769

            l_stmt := l_select||' , :l_old_value old_value'||
                      l_from||' ,oks_k_headers_v oksh '||
                      l_where||' AND oksh.chr_id = okh.id
                                 AND okh.scs_code = :update_level_value';
Line: 4778

              l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.inv_print_profile,''N'') = :p_ctr_rec_old_value
                                   AND okh.scs_code = :update_level_value';
Line: 4794

              l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id is NULL
     					          AND okh.scs_code = :update_level_value';
Line: 4800

 /*             l_stmt := l_select||' ,NULL old_value'||
                       l_from||
                       l_where||' AND EXISTS (SELECT id from okc_k_headers_v a
                                    WHERE a.id = okh.id
                                    MINUS
                                    SELECT okg.included_chr_id
                                    FROM okc_k_groups_grpings_v okg
									WHERE okg.included_chr_id = okh.id)
     					          AND okh.scs_code='''||p_ctr_rec.update_level_value||'''';
Line: 4812

              l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okh.scs_code = :update_level_value';
Line: 4818

              l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id = to_number(:p_ctr_rec_old_value)
     					          AND okh.scs_code = :update_level_value';
Line: 4831

             l_stmt := l_select||',to_char(okh.start_date) old_value'||
                       l_from||
                       l_where||' AND okh.start_date is NULL
						          AND okh.scs_code = :update_level_value';
Line: 4836

             l_stmt := l_select||',to_char(okh.start_date) old_value'||
                       l_from||
                       l_where||' AND trunc(okh.start_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
						          AND okh.scs_code = :update_level_value';
Line: 4849

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND okh.end_date is NULL
						          AND okh.scs_code = :update_level_value';
Line: 4854

             l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND trunc(okh.end_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
						          AND okh.scs_code = :update_level_value';
Line: 4864

 ELSIF p_ctr_rec.update_level = 'OKS_K_GROUP' THEN

 --------------------------------------------------------
 --  Update Level : Contract Group , Attribute: Revenue Account(REV_ACCT)
 --------------------------------------------------------
      IF p_ctr_rec.attribute = 'REV_ACCT' THEN

	     IF p_ctr_rec.old_value = '-9999' THEN   -- For old Value as NULL
             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id is NULL)
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 4883

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id)
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 4895

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKS_REV_DISTRIBUTIONS_V rev
                                     WHERE rev.chr_id = okh.id
                                     AND   rev.code_combination_id  = to_number(:p_ctr_rec_old_value))
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 4917

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                       ' AND  okh.PAYMENT_TERM_ID is NULL
                         AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)' ;
Line: 4928

                       l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                               'AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)' ;
Line: 4938

             l_stmt := l_select||' ,okh.payment_term_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.payment_term_id = to_number(:p_ctr_rec_old_value)
                         AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)' ;
Line: 4956

                       l_stmt := l_select||' ,NULL old_value' ||
                       l_from||
                       l_where||
                       ' AND  okh.renewal_type_code is NULL
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)' ;
Line: 4979

                       l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where||
                               ' AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                                 AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)' ;
Line: 5003

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND  okh.renewal_type_code = ''NSR''
                        AND ''ERN'' = :p_ctr_rec_old_value
                        AND oksh.ELECTRONIC_RENEWAL_FLAG =''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)' ;
Line: 5032

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||' ,oks_k_headers_b oksh'||
                       l_where||
                       ' AND oksh.chr_id = okh.id
                        AND  okh.renewal_type_code = :p_ctr_rec_old_value
                         AND nvl(oksh.ELECTRONIC_RENEWAL_FLAG,''N'') <>''Y''
                         AND not exists(
                                        select ol.object_chr_id
                                        from okc_operation_lines ol
                                            ,okc_operation_instances oi
                                            ,okc_class_operations co
                                        WHERE ol.object_chr_id = okh.id
                                          AND ol.process_flag = ''P''
                                          AND ol.ACTIVE_YN    = ''Y''
                                          AND oi.id = ol.oie_id
                                          AND oi.cop_id = co.id
                                          AND co.opn_code in (''RENEWAL'',''REN_CON'')
                                          AND co.CLS_CODE = ''SERVICE'')
                         AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)' ;
Line: 5064

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||
                        l_where|| 'AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21)
                                            AND cln.price_list_id is NULL)
                                   AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5078

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                          Where cln.dnz_chr_id = okh.id
                                            AND cln.lse_id in(3,16,21))
                                   AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5091

             l_stmt := l_select||' , :l_old_value old_value' ||
                       l_from||
                       l_where|| ' AND exists ( Select dnz_chr_id from okc_k_lines_b cln
                                      Where cln.dnz_chr_id = okh.id
                                      AND cln.lse_id in(3,16,21)
                                      AND cln.price_list_id = to_number(:p_ctr_rec_old_value))
                                  AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5113

              l_stmt := l_select||' ,NULL old_value' ||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where|| 'AND oksh.chr_id = okh.id
                                   AND oksh.acct_rule_id IS NULL
                                   AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                        WHERE okg1.included_chr_id is not null
                                        START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                        CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5124

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                        WHERE okg1.included_chr_id is not null
                                        START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                        CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5134

             l_stmt := l_select||' ,oksh.acct_rule_id old_value' ||
                       l_from||' ,oks_k_headers_v oksh '||
                       l_where|| 'AND oksh.chr_id = okh.id
                                  AND oksh.acct_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                        WHERE okg1.included_chr_id is not null
                                        START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                        CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5155

             l_stmt := l_select||' ,NULL old_value' ||
                       l_from||l_where||
                             ' AND  okh.inv_rule_id IS NULL
                               AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5164

                    l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                              l_from||l_where||
                                    ' AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5174

                l_stmt := l_select||' ,okh.inv_rule_id old_value' ||
                          l_from||l_where||
                                ' AND  okh.inv_rule_id = to_number(:p_ctr_rec_old_value)
                                  AND  okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                   WHERE okg1.included_chr_id is not null
                                                   START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                   CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5192

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V okl, oks_k_lines_v oksl
                                             WHERE okl.dnz_chr_id = okh.id
                                             AND oksl.cle_id      = okl.id
                                             AND oksl.coverage_type is NULL )
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5208

                l_stmt := l_select||' , :l_old_value old_value'||
                          l_from||
                          l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                    WHERE okl.dnz_chr_id = okh.id
                                    AND oksl.cle_id      = okl.id )
                                    AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5221

                 l_stmt := l_select||' , :l_old_value old_value'||
                           l_from||
                           l_where||'AND EXISTS (SELECT ''x'' from okc_k_lines_v okl, oks_k_lines_v oksl
                                     WHERE okl.dnz_chr_id   = okh.id
                                     AND oksl.cle_id        = okl.id
                                     AND oksl.coverage_type = :p_ctr_rec_old_value )
                                     AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5243

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                      WHERE ctz.dnz_chr_id = okh.id
                                      AND   ctz.timezone_id IS NULL )
                                      AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                      WHERE okg1.included_chr_id is not null
                                                      START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                      CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5257

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND   ctz.timezone_id IS NOT NULL )
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5270

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from  oks_coverage_timezones_v ctz
                                             WHERE ctz.dnz_chr_id = okh.id
                                             AND  ctz.timezone_id = to_number(:p_ctr_rec_old_value))
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5289

                l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE'')
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5303

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''ENGINEER''
                                             AND   oco.jtot_object1_code = ''OKX_RESOURCE''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5324

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP'')
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5338

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from
                                             okc_contacts oco
                                             WHERE oco.dnz_chr_id = okh.id
                                             AND   oco.cro_code = ''RSC_GROUP''
                                             AND   oco.jtot_object1_code = ''OKS_RSCGROUP''
                                             AND   oco.object1_id1  = :p_ctr_rec_old_value)
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5360

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||'AND EXISTS (SELECT ''x'' from okc_governances_v ogv
                                             WHERE ogv.dnz_chr_id = okh.id
                                             AND   ogv.isa_agreement_id = :p_ctr_rec_old_value)
                                             AND okh.id in(  SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                             WHERE okg1.included_chr_id is not null
                                                             START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                             CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5378

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen is NULL)
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5390

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35))
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5403

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.dnz_chr_id = okh.id
                                     AND   cle.lse_id IN (7,8,9,10,11,18,25,35)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5421

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen is NULL)
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5433

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19))
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5445

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (SELECT ''x'' from OKC_K_LINES_V cle
                                     WHERE cle.chr_id = okh.id
                                     AND   cle.lse_id IN (1,12,14,19)
                                     AND   cle.cognomen = :p_ctr_rec_old_value)
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5464

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                ' AND  okh.ship_to_site_use_id is NULL
                                  AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                 WHERE okg1.included_chr_id is not null
                                                 START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                 CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5475

                 l_stmt := l_select||' ,okh.ship_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.ship_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                 WHERE okg1.included_chr_id is not null
                                                 START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                 CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5491

                 l_stmt := l_select||' ,NULL old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id is NULL
                                     AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                 WHERE okg1.included_chr_id is not null
                                                 START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                 CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5501

                 l_stmt := l_select||' ,okh.bill_to_site_use_id old_value' ||
                           l_from||l_where||
                                   ' AND  okh.bill_to_site_use_id = to_number(:p_ctr_rec_old_value)
                                     AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                 WHERE okg1.included_chr_id is not null
                                                 START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                 CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5516

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5530

             l_stmt := l_select||' ,oc.object1_id1 old_value '||
                       l_from||', okc_contacts oc '||
                       l_where||' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SALESPERSON''
                          and   oc.jtot_object1_code = ''OKX_SALEPERS''
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5541

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND (EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SALESPERSON''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_SALEPERS'')
                         OR EXISTS (Select ''x'' from oks_k_sales_credits_v osc
                                   Where osc.chr_id = okh.id
                                   and osc.ctc_id = to_number(:p_ctr_rec_old_value)))
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5564

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5577

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5590

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''SHIPPING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5610

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5623

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''BILLING''
                          and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5635

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''BILLING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_PCONTACT'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5654

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5667

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_SHIPPING''
                          and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5680

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_SHIPPING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTSHIP'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5700

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1 is null
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5713

             l_stmt := l_select||' ,oc.object1_id1 old_value'||
                       l_from||', okc_contacts oc '||
                       l_where||
                        ' and oc.dnz_chr_id = okh.id
                          and   oc.cro_code = ''CUST_BILLING''
                          and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5725

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_contacts oc
                                         where oc.dnz_chr_id = okh.id
                                         and   oc.cro_code = ''CUST_BILLING''
                                         and   oc.object1_id1=:p_ctr_rec_old_value
                                         and   oc.jtot_object1_code = ''OKX_CONTBILL'')
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5746

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                         where igs.dnz_chr_id = okh.id
                                         and   ((igs.start_hour is null
                                         and   igs.start_minute is null)
                                         OR
                                         (     igs.end_hour is null
                                         and   igs.end_minute is null))
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5764

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from okc_time_ig_startend_val_v igs
                                      where igs.dnz_chr_id = okh.id
                                      and  (( igs.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                      AND   igs.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                                      OR
                                      ( igs.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                      AND   igs.end_minute = mod(to_number(:p_ctr_rec_old_value),60)))
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5790

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.start_hour is null
                                         and   oct.start_minute is null)
                        AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5805

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.start_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.start_minute = mod(to_number(:p_ctr_rec_old_value),60))
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5825

             l_stmt := l_select||' ,NULL old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                         where oct.dnz_chr_id = okh.id
                                         and   oct.end_hour is null
                                         and   oct.end_minute is null)
                        AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5838

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||l_where||
                       ' AND EXISTS (Select ''x'' from oks_coverage_times_v oct
                                     where oct.dnz_chr_id = okh.id
                                     and   oct.end_hour = trunc(to_number(:p_ctr_rec_old_value)/60)
                                     and   oct.end_minute = mod(to_number(:p_ctr_rec_old_value),60))
                        AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5857

             l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '|| l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                 OR mon_duration IS NULL
                                 OR tue_duration IS NULL
                                 OR wed_duration IS NULL
                                 OR thu_duration IS NULL
                                 OR fri_duration IS NULL
                                 OR sat_duration IS NULL)

                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5882

            l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RSN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                         AND okh.id in (SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5909

                       l_stmt := l_select||', NULL old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       '  AND kl.dnz_chr_id = okh.id
		          AND kl.id = att.cle_id
                          And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration IS NULL
                                               OR mon_duration IS NULL
                                               OR tue_duration IS NULL
                                               OR wed_duration IS NULL
                                               OR thu_duration IS NULL
                                               OR fri_duration IS NULL
                                               OR sat_duration IS NULL)
                        AND okh.id in(SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5930

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||',okc_k_lines_b kl, oks_action_time_types_v att , oks_action_times_v oat '||l_where||
                       ' AND kl.dnz_chr_id = okh.id
		         AND kl.id = att.cle_id
                         And kl.lse_id in (4,17,22)
                         AND   att.action_type_code = ''RCN''
                         AND   att.id = oat.cov_action_type_id
                         AND   ( sun_duration = :p_ctr_rec_old_value
                                               OR mon_duration = :p_ctr_rec_old_value
                                               OR tue_duration = :p_ctr_rec_old_value
                                               OR wed_duration = :p_ctr_rec_old_value
                                               OR thu_duration = :p_ctr_rec_old_value
                                               OR fri_duration = :p_ctr_rec_old_value
                                               OR sat_duration = :p_ctr_rec_old_value)
                        AND okh.id in(SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                       WHERE okg1.included_chr_id is not null
                                       START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                       CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5958

              l_stmt := l_select||' ,NULL old_value'||
                        l_from||l_where||
                         ' AND  okh.price_list_id is NULL
                           AND okh.id in( SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                        WHERE okg1.included_chr_id is not null
                                        START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                        CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5969

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                         l_from||l_where||
                         ' AND okh.id in( SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                        WHERE okg1.included_chr_id is not null
                                        START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                        CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5979

             l_stmt := l_select||' ,okh.price_list_id old_value' ||
                       l_from||l_where||
                       ' AND  okh.price_list_id = to_number(:p_ctr_rec_old_value)
                         AND okh.id in( SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                        WHERE okg1.included_chr_id is not null
                                        START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                        CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 5994

             l_stmt := l_select||' ,  NULL old_value'||
                       l_from||
                       l_where||' AND okh.cognomen IS NULL
                                  AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6004

             l_stmt := l_select||' ,okh.cognomen old_value'||
                       l_from||
                       l_where||' AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6012

             l_stmt := l_select||', okh.cognomen old_value'||
                       l_from||
                       l_where||' AND okh.cognomen = :p_ctr_rec_old_value
                                  AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6029

             l_stmt := l_select||' ,  NULL old_value'||
                       l_from||
                       l_where||' AND okh.cust_po_number IS NULL
                                  AND ( okh.payment_instruction_type  Is Null Or okh.payment_instruction_type = ''PON'')
                                  AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6043

                  l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||'   AND okh.payment_instruction_type = ''PON'' AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.inclued_cgp_id)
				  AND okh.cust_po_number_req_yn <> ''Y''';
Line: 6053

		   l_stmt := l_select||' ,okh.cust_po_number old_value'||
                       l_from||
                       l_where||'  AND okh.payment_instruction_type = ''PON'' AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.inclued_cgp_id)';
Line: 6068

                       l_stmt := l_select||' ,okh.cust_po_number old_value'||
                                 l_from||
                                 l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value
                                            AND okh.payment_instruction_type = ''PON''
                                            AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)
					    And okh.cust_po_number_req_yn <> ''Y''';
Line: 6080

	                 l_stmt := l_select||' ,okh.cust_po_number old_value'||
                                 l_from||
                                 l_where||' AND okh.cust_po_number = :p_ctr_rec_old_value
                                            AND okh.payment_instruction_type = ''PON''
                                            AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6102

             l_stmt := l_select||' , :l_old_value old_value'||
                       l_from||
                       l_where||
                       'AND okh.id in(
                                               SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6115

             l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.renewal_po_required,''N'') = :p_ctr_rec_old_value
                                   AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6135

            l_stmt := l_select||' , :l_old_value old_value'||
                      l_from||' ,oks_k_headers_v oksh '||
                      l_where||' AND oksh.chr_id = okh.id
                                 AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6149

              l_stmt := l_select||' , :l_old_value old_value'||
                        l_from||' ,oks_k_headers_v oksh '||
                        l_where||' AND oksh.chr_id = okh.id
                                   AND nvl(oksh.inv_print_profile,''N'') = :p_ctr_rec_old_value
                                   AND okh.id in(
                                                SELECT distinct okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6169

        l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                  l_from||',okc_k_groups_grpings_v okg'||
                  l_where||' AND okg.included_chr_id = okh.id
     	                     AND okg.cgp_parent_id is NULL
                             AND okh.id in(
                                               SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6179

              l_stmt := l_select||' ,NULL old_value'||
                       l_from||
                       l_where||' AND EXISTS (SELECT id from okc_k_headers_v a
                                    WHERE a.id = okh.id
                                    MINUS
                                    SELECT okg.included_chr_id
                                    FROM okc_k_groups_grpings_v okg
			       	    WHERE okg.included_chr_id = okh.id)
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = '||to_number(p_ctr_rec.update_level_value)||'
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6196

              l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
                                  AND (okg.cgp_parent_id in(
                                                SELECT okg1.included_cgp_id from  okc_k_grpings okg1
                                                WHERE okg1.included_cgp_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id))
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6210

              l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
                                  AND (okg.cgp_parent_id = to_number(:update_level_value)
                                       OR okg.cgp_parent_id in(
                                                SELECT okg1.included_cgp_id from  okc_k_grpings okg1
                                                WHERE okg1.included_cgp_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id))
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6226

              l_stmt := l_select||' ,okg.cgp_parent_id old_value'||
                       l_from||',okc_k_groups_grpings_v okg'||
                       l_where||' AND okg.included_chr_id = okh.id
     					          AND okg.cgp_parent_id = to_number(:p_ctr_rec_old_value)
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6243

              l_stmt := l_select||',to_char(okh.start_date) old_value'||
                       l_from||
                       l_where||' AND okh.start_date is NULL
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6252

              l_stmt := l_select||',to_char(okh.start_date) old_value'||
                       l_from||
                       l_where||' AND trunc(okh.start_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6268

              l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND okh.end_date is NULL
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6277

              l_stmt := l_select||',to_char(okh.end_date) old_value'||
                       l_from||
                       l_where||' AND trunc(okh.end_date) = trunc(to_date(:p_ctr_rec_old_value,''YYYY/MM/DD HH24:MI:SS''))
                                  AND okh.id in(
                                                SELECT okg1.included_chr_id from  okc_k_grpings okg1
                                                WHERE okg1.included_chr_id is not null
                                                START WITH okg1.cgp_parent_id = to_number(:update_level_value)
                                                CONNECT BY okg1.cgp_parent_id = PRIOR okg1.included_cgp_id)';
Line: 6310

	    	 	     , p_ctr_rec.update_level_value,l_org_id;
Line: 6313

	    	 	using p_ctr_rec.oie_id , p_ctr_rec.update_level_value,l_org_id;
Line: 6321

                                    , p_ctr_rec.update_level_value ,l_org_id;
Line: 6327

                               ,p_ctr_rec.update_level_value,l_org_id;
Line: 6336

                                    p_ctr_rec.old_value, p_ctr_rec.update_level_value,l_org_id;
Line: 6340

                             p_ctr_rec.old_value, p_ctr_rec.update_level_value,l_org_id;
Line: 6352

                             using l_old_value, p_ctr_rec.update_level_value,l_org_id;
Line: 6355

                             using p_ctr_rec.update_level_value,l_org_id;
Line: 6362

                                   p_ctr_rec.old_value , p_ctr_rec.update_level_value,l_org_id;
Line: 6368

                                    p_ctr_rec.update_level_value,l_org_id;
Line: 6376

                                 p_ctr_rec.update_level_value,l_org_id;
Line: 6379

                                 p_ctr_rec.update_level_value,l_org_id;
Line: 6402

                              using l_old_value, p_ctr_rec.oie_id , p_ctr_rec.update_level_value;
Line: 6405

	  	              using p_ctr_rec.oie_id , p_ctr_rec.update_level_value;
Line: 6412

	                          , p_ctr_rec.update_level_value;
Line: 6417

	                          , p_ctr_rec.update_level_value, l_org_id;
Line: 6421

                           p_ctr_rec.old_value, p_ctr_rec.update_level_value, l_org_id;
Line: 6426

	  	 	    p_ctr_rec.old_value,p_ctr_rec.old_value,p_ctr_rec.update_level_value;
Line: 6434

                           p_ctr_rec.old_value, p_ctr_rec.update_level_value;
Line: 6437

                            p_ctr_rec.old_value, p_ctr_rec.update_level_value;
Line: 6449

	  	          using l_old_value, p_ctr_rec.update_level_value;
Line: 6451

	  	          OPEN v_CurContract FOR l_stmt using p_ctr_rec.update_level_value;
Line: 6457

                                p_ctr_rec.old_value , p_ctr_rec.update_level_value;
Line: 6461

                                p_ctr_rec.old_value , p_ctr_rec.update_level_value, l_org_id;
Line: 6465

	  	  	     p_ctr_rec.update_level_value, l_org_id;
Line: 6471

                                  p_ctr_rec.update_level_value;
Line: 6479

	  	  	     p_ctr_rec.update_level_value;
Line: 6482

                               p_ctr_rec.update_level_value;
Line: 6526

                          p_ctr_rec.update_level_value,l_org_id;
Line: 6529

                         p_ctr_rec.update_level_value,l_org_id;
Line: 6536

                       p_ctr_rec.old_value , p_ctr_rec.update_level_value,l_org_id;
Line: 6542

                         p_ctr_rec.update_level_value,l_org_id;
Line: 6550

                        p_ctr_rec.old_value,p_ctr_rec.update_level_value,l_org_id;
Line: 6553

                        p_ctr_rec.old_value,p_ctr_rec.update_level_value,l_org_id;
Line: 6569

	                p_ctr_rec.update_level_value;
Line: 6572

	                p_ctr_rec.update_level_value;
Line: 6578

                       p_ctr_rec.old_value , p_ctr_rec.update_level_value;
Line: 6582

                       p_ctr_rec.old_value , p_ctr_rec.update_level_value, l_org_id;
Line: 6586

                        p_ctr_rec.old_value, p_ctr_rec.update_level_value,l_org_id;
Line: 6592

                         p_ctr_rec.update_level_value;
Line: 6600

                        p_ctr_rec.old_value,p_ctr_rec.update_level_value;
Line: 6603

                        p_ctr_rec.old_value,p_ctr_rec.update_level_value;
Line: 6764

         SELECT name, usr.user_name
         FROM okc_operation_instances_v oie,
              fnd_user usr
         WHERE id = p_oie_id
         AND   oie.last_updated_by = usr.user_id;
Line: 6915

            SELECT oie.name,
                   oie.jtot_object1_code update_level,
                   oie.object1_id1 update_level_value,
                   omr.ATTRIBUTE_NAME attribute,
                   omr.OLD_VALUE old_value,
                   omr.NEW_VALUE new_value
            FROM   okc_operation_instances_v oie,
                   okc_masschange_req_dtls omr
            WHERE  oie.id = omr.oie_id
            AND    oie.id = p_oie_id;
Line: 6927

            SELECT id
            FROM okc_k_grpings_v
            WHERE included_chr_id = p_chr_id
            AND   cgp_parent_id = p_cgp_id;
Line: 6933

           SELECT oct.id,oct.OBJECT_VERSION_NUMBER,
                  oct.start_hour,oct.start_minute,oct.end_hour,oct.end_minute
           FROM oks_coverage_timezones_v ctz ,
                oks_coverage_times_v oct
           WHERE  oct.cov_tze_line_id = ctz.id
           AND    oct.dnz_chr_id = p_chr_id
           AND    oct.start_hour = p_hour
           AND    oct.start_minute = p_minute ;
Line: 6943

           SELECT oct.id ,oct.OBJECT_VERSION_NUMBER,
                  oct.start_hour,oct.start_minute,oct.end_hour,oct.end_minute
           FROM oks_coverage_timezones_v ctz ,
                oks_coverage_times_v oct
           WHERE  oct.cov_tze_line_id = ctz.id
           AND    oct.dnz_chr_id = p_chr_id
           AND    oct.end_hour = p_hour
           AND    oct.end_minute = p_minute ;
Line: 6954

           SELECT oct.id id
           FROM   oks_coverage_timezones_V oct
           WHERE  oct.dnz_chr_id  = p_chr_id;
Line: 6959

           SELECT oct.id id,oct.OBJECT_VERSION_NUMBER,oct.cle_id cle_id
           FROM   oks_coverage_timezones_V oct
           WHERE  oct.dnz_chr_id  = p_chr_id
           AND    oct.timezone_id = p_old_value ;
Line: 6965

           SELECT oksh.id , oksh.object_version_number
           FROM   oks_k_headers_b oksh
           WHERE  oksh.chr_id = p_chr_id
           AND    oksh.acct_rule_id = p_old_value ;
Line: 6971

           SELECT oksh.id , oksh.object_version_number
           FROM   oks_k_headers_b oksh
           WHERE  oksh.chr_id = p_chr_id
           AND    nvl(oksh.inv_print_profile,'N') = p_old_value ;
Line: 6977

           SELECT oksh.id , oksh.object_version_number
           FROM   oks_k_headers_b oksh
           WHERE  oksh.chr_id = p_chr_id;
Line: 6982

           SELECT oksh.id , oksh.object_version_number
           FROM   oks_k_headers_v oksh
           WHERE  oksh.chr_id = p_chr_id
           AND    nvl(oksh.renewal_po_required,'N') = p_old_value ;
Line: 6988

           SELECT ogv.id, ogv.object_version_number
           FROM   okc_governances_v ogv
           WHERE  ogv.dnz_chr_id = p_chr_id
           AND    ogv.isa_agreement_id = p_old_value ;
Line: 6995

           SELECT oc.id, oc.object_version_number, kh.start_date start_date
           FROM   okc_contacts oc , okc_k_headers_b kh
           WHERE  oc.dnz_chr_id = p_chr_id
           AND    oc.cro_code = p_cro_code
           AND    oc.object1_id1 = p_old_value
           AND    oc.jtot_object1_code = p_object_code
           And    Kh.id = oc.dnz_chr_id;
Line: 7004

           SELECT rev.id, rev.object_version_number
           FROM   oks_rev_distributions_v rev
           WHERE  rev.chr_id = p_chr_id
           AND    rev.code_combination_id = p_old_value;
Line: 7010

           SELECT srv.id, srv.object_version_number, kh.start_date
           FROM   OKS_K_SALES_CREDITS_V srv
                 , Okc_k_headers_b Kh
           WHERE  srv.cle_id Is Null
           And    kh.id = p_chr_id
           And    kh.id = srv.chr_id
           AND    srv.ctc_id = to_number(p_old_value);
Line: 7020

           SELECT srv.id, srv.object_version_number, kl.start_date
           FROM   OKS_K_SALES_CREDITS_V srv
                , Okc_k_lines_b Kl
           WHERE  srv.chr_id = p_chr_id
           And    srv.Cle_id Is nOt null
           And    Kl.id = srv.cle_id
           AND    srv.ctc_id = to_number(p_old_value);
Line: 7030

	        SELECT okh.id,
                   okh.contract_number,
                   okh.contract_number_modifier,
                   okh.short_description,
                   okh.sts_code,
                   ole.id ole_id,
                   mrd.old_value,
		   okh.billed_at_source

            FROM  okc_k_headers_v okh,
                  okc_operation_lines_v ole,
                  okc_masschange_req_dtls_v mrd
      	    WHERE ole.select_yn = 'Y'
			AND   ole.process_flag is NULL
            AND   okh.id = ole.subject_chr_id
            AND   ole.id = mrd.ole_id
            AND   ole.oie_id = p_oie_id;
Line: 7053

           SELECT okl.id id
           FROM   okc_k_lines_b okl
                 ,Oks_k_lines_b oks
           WHERE  okl.dnz_chr_id = p_chr_id
	     AND    okl.date_cancelled is NULL
           And    okl.id = oks.cle_id
           AND   ( okl.lse_id in (1,14,19,46)
           or   (okl.lse_id = 12 and oks.usage_type in ('FRT','NPR'))) ;
Line: 7063

           SELECT okl.id id
           FROM   okc_k_lines_b okl
           WHERE  okl.dnz_chr_id = p_chr_id
	     AND    okl.date_cancelled is NULL
           AND    okl.lse_id in (1,12,14,19,46) ;
Line: 7070

           SELECT count(*) FROM oks_pm_schedules_v
           WHERE cle_id = p_cle_id;
Line: 7075

           SELECT oat.id id ,oat.sun_duration ,oat.mon_duration ,oat.tue_duration ,oat.wed_duration,
                  oat.thu_duration ,oat.fri_duration, oat.sat_duration, oat.object_version_number
           FROM   OKC_K_LINES_V okl, oks_action_times oat , oks_action_time_types att
           WHERE  okl.dnz_chr_id     = p_chr_id
           AND    att.cle_id         = okl.id
           AND    att.action_type_code = p_action_type_code
           AND    oat.cov_action_type_id = att.id
           AND    (oat.sun_duration = p_old_value
                OR oat.mon_duration = p_old_value
                OR oat.tue_duration = p_old_value
                OR oat.wed_duration = p_old_value
                OR oat.thu_duration = p_old_value
                OR oat.fri_duration = p_old_value
                OR oat.sat_duration = p_old_value ) ;
Line: 7091

          SELECT osl.id , osl.object_version_number
          FROM   okc_k_lines_v okl, oks_k_lines_v osl
          WHERE  okl.id = osl.cle_id
          AND   okl.dnz_chr_id = p_chr_id
          AND   okl.lse_id in( 2,15,20)
          AND   osl.coverage_type = p_old_value  ;
Line: 7099

           SELECT cln.id , cln.object_version_number
           FROM  okc_k_lines_b cln
           Where  cln.dnz_chr_id = p_chr_id
            AND cln.lse_id in(3,16,21)
            AND cln.price_list_id = p_old_value ;
Line: 7106

           SELECT cln.id , cln.object_version_number
           FROM  okc_k_lines_b cln
           Where  cln.dnz_chr_id = p_chr_id
            AND cln.lse_id in(3,16,21);
Line: 7112

           SELECT cln.id , cln.object_version_number
           FROM  okc_k_lines_b cln
           Where  cln.dnz_chr_id = p_chr_id
            AND cln.lse_id in(3,16,21)
            AND cln.price_list_id is null ;
Line: 7119

	    Select okch.currency_code
	    From okc_k_headers_b okch
	    Where okch.id = p_id ;
Line: 7211

    l_restricted_update	          VARCHAR2(100)  ;
Line: 7213

    l_can_update_yn               VARCHAR2(1);
Line: 7228

    l_update_level_code           VARCHAR2(300);
Line: 7229

    l_update_level_value_id       VARCHAR2(300);
Line: 7230

    l_update_level                VARCHAR2(360);
Line: 7231

    l_update_level_value          VARCHAR2(360);
Line: 7340

          l_stmt:= 'SELECT cle.id,object_version_number,lse_id FROM  okc_k_lines_v cle
                    WHERE  cle.date_cancelled is NULL
		      AND  cle.dnz_chr_id = :p_chr_id';
Line: 7474

          l_stmt:= 'SELECT ksl.id,ksl.object_version_number,ksl.invoice_text
                    FROM   oks_k_lines_v ksl, okc_k_lines_b kcl
                    WHERE  kcl.date_cancelled is NULL
                    AND    kcl.dnz_chr_id = :p_chr_id
                    AND    kcl.id = ksl.cle_id
                    AND    kcl.lse_id IN (7,8,9,10,11,18,25,35,1,12,14,19)';
Line: 7595

           SELECT meaning FROM fnd_lookups
           WHERE lookup_type like 'OKS_MSCHG_LEVEL%'
           AND   lookup_code = p_lookup_code
           AND   rownum =1;
Line: 7614

         SELECT estimated_amount FROM okc_k_headers_v WHERE id = p_chr_id;
Line: 7629

         SELECT ste_code FROM okc_statuses_v WHERE code = sts_code;
Line: 7665

           SELECT id FROM okc_k_headers_b okh
           WHERE
           Exists (select 'x' from OKC_K_LINES_B cle
                 where cle.dnz_chr_id = okh.id
                   and cle.lse_id = 14 )
           AND okh.id = p_chr_id ;
Line: 7696

     Select code
      From  OKC_STATUSES_B
      Where ste_code = p_ste_code
        And default_yn = 'Y';
Line: 7753

      l_restricted_update    := 'F' ;
Line: 7791

	     ,l_update_level_code
	     ,l_update_level_value_id
	     ,l_attribute_code
	     ,l_old_value_id_tmp
	     ,l_new_value_id;
Line: 7811

	l_criteria_rec.update_level       := l_update_level_code;
Line: 7812

	l_criteria_rec.update_level_value := l_update_level_value_id;
Line: 7818

        l_update_level := Get_lookup_value(p_lookup_code => l_update_level_code);
Line: 7820

        l_update_level_value := OKC_UTIL.GET_NAME_FROM_JTFV(p_object_code =>l_update_level_code,
                                                            p_id1 => l_update_level_value_id,
                                                            p_id2 => '#');
Line: 7839

	LOG_MESSAGES('Update_level (Stored Code)       :'||l_criteria_rec.update_level);
Line: 7840

        LOG_MESSAGES('Update_level_value (Stored Code) :'||l_criteria_rec.update_level_value);
Line: 7846

        LOG_MESSAGES('Update Level       :  '||l_update_level);
Line: 7847

        LOG_MESSAGES('Update Level value :  '||l_update_level_value);
Line: 7888

      LOG_MESSAGES('Updating all selected (A,E) operation lines STATUS to NULL   ...'||l_eligible_contracts_tbl.COUNT);
Line: 7890

      UPDATE_LINE_STATUS(p_oie_id    => l_criteria_rec.oie_id);
Line: 7965

               l_chrv_tbl_in.DELETE;
Line: 7997

                  LOG_MESSAGES('Fetching contract lines for update');
Line: 7998

                  l_clev_tbl_in.DELETE;
Line: 8009

                       LOG_MESSAGES('Locking contract lines for update, lines count:'||l_clev_tbl_in.COUNT);
Line: 8024

                      l_klnv_tbl_type_in.DELETE;
Line: 8034

		       LOG_MESSAGES('Locking oks contract lines for update, lines count:'||l_klnv_tbl_type_in.COUNT);
Line: 8052

                          OKC_CONTRACT_PUB.update_contract_header (
                        	       p_api_version		=> l_api_version,
                          	       p_init_msg_list		=> l_init_msg_list,
                        	       x_return_status		=> l_return_status,
                        	       x_msg_count     	        => l_msg_count,
                         	       x_msg_data               => l_msg_data,
                        	       p_chrv_rec               => l_chrv_rec_in,
    	                               x_chrv_rec               => l_chrv_rec_out );
Line: 8061

                           IF l_return_status = G_RET_STS_SUCCESS THEN -- contract update
                               LOG_MESSAGES('CONTRACT_HEADER(Start_Date) update status: '||l_return_status);
Line: 8070

                                    OKC_CONTRACT_PUB.update_contract_line(
                            	                  p_api_version	    => l_api_version,
                              	                  p_init_msg_list   => l_init_msg_list,
                            	                  x_return_status   => l_return_status,
                            	                  x_msg_count	    => l_msg_count,
                             	                  x_msg_data	    => l_msg_data,
                                                  p_clev_tbl        => l_clev_tbl_in,
                                                  x_clev_tbl        => l_clev_tbl_out);
Line: 8081

                                    LOG_MESSAGES('CONTRACT_HEADER_LINES(Start_Date) update status: '||l_return_status);
Line: 8088

                                        oks_contract_line_pub.update_line
                                          (p_api_version        => l_api_version,
                                           p_init_msg_list      => l_init_msg_list,
                                           x_return_status      => l_return_status,
                                           x_msg_count          => l_msg_count,
                                           x_msg_data           => l_msg_data,
                                           p_klnv_tbl           => l_klnv_tbl_type_in,
                                           x_klnv_tbl           => l_klnv_tbl_type_out,
                                           p_validate_yn        => 'N'
                                          );
Line: 8098

					  LOG_MESSAGES('CONTRACT_HEADER_OKS_LINES(Start_Date) update status: '||l_return_status);
Line: 8110

					      LOG_MESSAGES('CONTRACT_OKS_LINES(Contract_Start_Date) update status: '||l_return_status);
Line: 8111

                                              LOG_MESSAGES('Contract oks Lines(Contract_Start_Date) Update failed;'||l_message);
Line: 8129

                                   LOG_MESSAGES('CONTRACT_LINES(Contract_Start_Date) update status: '||l_return_status);
Line: 8130

                                   LOG_MESSAGES('Contract Lines(Contract_Start_Date) Update failed;'||l_message);
Line: 8133

                                END IF; -- contract line update status
Line: 8145

                               LOG_MESSAGES('CONTRACT_HEADERS(Contract_Start_Date) update status: '||l_return_status);
Line: 8146

                               LOG_MESSAGES('Contract Header(Contract_Start_Date) Update failed;'||l_message);
Line: 8149

                           END IF; -- Contract update
Line: 8226

               l_chrv_tbl_in.DELETE;
Line: 8257

                  LOG_MESSAGES('Fetching contract lines for update');
Line: 8258

                  l_clev_tbl_in.DELETE;
Line: 8267

                       LOG_MESSAGES('Locking contract lines for update, lines count:'||l_clev_tbl_in.COUNT);
Line: 8282

                      l_klnv_tbl_type_in.DELETE;
Line: 8292

		       LOG_MESSAGES('Locking oks contract lines for update, lines count:'||l_klnv_tbl_type_in.COUNT);
Line: 8310

                          OKC_CONTRACT_PUB.update_contract_header (
                        	       p_api_version		=> l_api_version,
                          	       p_init_msg_list		=> l_init_msg_list,
                        	       x_return_status		=> l_return_status,
                        	       x_msg_count     	        => l_msg_count,
                         	       x_msg_data               => l_msg_data,
                        	       p_chrv_rec               => l_chrv_rec_in,
    	                               x_chrv_rec               => l_chrv_rec_out );
Line: 8319

                           IF l_return_status = G_RET_STS_SUCCESS THEN -- contract update
                               LOG_MESSAGES('CONTRACT_HEADER(End_Date) update status: '||l_return_status);
Line: 8328

                                    OKC_CONTRACT_PUB.update_contract_line(
                            	                  p_api_version	    => l_api_version,
                              	                  p_init_msg_list   => l_init_msg_list,
                            	                  x_return_status   => l_return_status,
                            	                  x_msg_count	    => l_msg_count,
                             	                  x_msg_data	    => l_msg_data,
                                                  p_clev_tbl        => l_clev_tbl_in,
                                                  x_clev_tbl        => l_clev_tbl_out);
Line: 8339

                                    LOG_MESSAGES('CONTRACT_HEADER_LINES(End_Date) update status: '||l_return_status);
Line: 8347

                                        oks_contract_line_pub.update_line
                                          (p_api_version        => l_api_version,
                                           p_init_msg_list      => l_init_msg_list,
                                           x_return_status      => l_return_status,
                                           x_msg_count          => l_msg_count,
                                           x_msg_data           => l_msg_data,
                                           p_klnv_tbl           => l_klnv_tbl_type_in,
                                           x_klnv_tbl           => l_klnv_tbl_type_out,
                                           p_validate_yn        => 'N'
                                          );
Line: 8357

					  LOG_MESSAGES('CONTRACT_HEADER_OKS_LINES(Start_Date) update status: '||l_return_status);
Line: 8369

					      LOG_MESSAGES('CONTRACT_OKS_LINES(Contract_Start_Date) update status: '||l_return_status);
Line: 8370

                                              LOG_MESSAGES('Contract oks Lines(Contract_Start_Date) Update failed;'||l_message);
Line: 8388

                                   LOG_MESSAGES('CONTRACT_LINES(Contract_End_Date) update status: '||l_return_status);
Line: 8389

                                   LOG_MESSAGES('Contract Lines(Contract_End_Date) Update failed;'||l_message);
Line: 8392

                                END IF; -- contract line update status
Line: 8404

                               LOG_MESSAGES('CONTRACT_HEADERS(Contract_End_Date) update status: '||l_return_status);
Line: 8405

                               LOG_MESSAGES('Contract Header(Contract_End_Date) Update failed;'||l_message);
Line: 8408

                           END IF; -- Contract update
Line: 8483

         End If; -- update attribute type( l_criteria_rec.attribute )
Line: 8519

                OKC_CTC_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_ctcv_rec            => l_ctcv_rec_in,
                                        x_ctcv_rec            => l_ctcv_rec_out);
Line: 8529

                        LOG_MESSAGES('SALES_PERSON in OKC_CONTACTS update status: '||l_return_status);
Line: 8545

                        LOG_MESSAGES('SALESPERSON in OKC_CONTACTS update status: '||l_return_status);
Line: 8546

                        LOG_MESSAGES('SALES Person in OKC_CONTACTS  Update failed;'||l_message);
Line: 8572

                        l_scrv_tbl_in.DELETE;
Line: 8610

                               OKS_SALES_CREDIT_PUB.update_Sales_credit(
                                                p_api_version         => l_api_version,
                                                p_init_msg_list       => l_init_msg_list,
                                                x_return_status       => l_return_status,
                                                x_msg_count           => l_msg_count,
                                                x_msg_data            => l_msg_data,
                                                p_scrv_tbl            => l_scrv_tbl_in,
                                                x_scrv_tbl            => l_scrv_tbl_out);
Line: 8620

                                LOG_MESSAGES('SALES_PERSON in OKS_SALES_CREDIT update status: '||l_return_status);
Line: 8635

                                LOG_MESSAGES('SALES_PERSON in OKS_SALES_CREDIT update status: '||l_return_status);
Line: 8636

                                LOG_MESSAGES('SALES_PERSON in OKS_SALES_CREDIT Update failed;'||l_message);
Line: 8680

                OKS_REV_DISTR_PUB.update_Revenue_Distr(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_rdsv_rec            => l_rdsv_rec_in,
                                        x_rdsv_rec            => l_rdsv_rec_out);
Line: 8690

                        LOG_MESSAGES('REVENUE_ACCOUNT update status: '||l_return_status);
Line: 8707

                        LOG_MESSAGES('REVENUE_ACCOUNT update status: '||l_return_status);
Line: 8708

                        LOG_MESSAGES('REVENUE_ACCOUNT Update failed;'||l_message);
Line: 8753

                OKC_CTC_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_ctcv_rec            => l_ctcv_rec_in,
                                        x_ctcv_rec            => l_ctcv_rec_out);
Line: 8763

                        LOG_MESSAGES('PARTY_SHIPPING_CONTACT update status: '||l_return_status);
Line: 8780

                        LOG_MESSAGES('PARTY_SHIPPING_CONTACT update status: '||l_return_status);
Line: 8781

                        LOG_MESSAGES('Party Shipping Contact Update failed;'||l_message);
Line: 8827

                OKC_CTC_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_ctcv_rec            => l_ctcv_rec_in,
                                        x_ctcv_rec            => l_ctcv_rec_out);
Line: 8835

        LOG_MESSAGES('After OKC_CTC_PVT.update_row, status:'||l_return_status);
Line: 8837

                        LOG_MESSAGES('PARTY_BILLING_CONTACT update status: '||l_return_status);
Line: 8854

                        LOG_MESSAGES('PARTY_BILLING_CONTACT update status: '||l_return_status);
Line: 8855

                        LOG_MESSAGES('Party Billing Contact Update failed;'||l_message);
Line: 8883

            l_ctcv_tbl_in.DELETE;
Line: 8884

            l_ctcv_tbl_out.DELETE;
Line: 8907

                OKC_CTC_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_ctcv_tbl            => l_ctcv_tbl_in,
                                        x_ctcv_tbl            => l_ctcv_tbl_out);
Line: 8917

                        LOG_MESSAGES('LINE_SHIPPING_CONTACT update status: '||l_return_status);
Line: 8934

                        LOG_MESSAGES('LINE_SHIPPING_CONTACT update status: '||l_return_status);
Line: 8935

                        LOG_MESSAGES('Line Shipping Contact Update failed;'||l_message);
Line: 8961

            l_ctcv_tbl_in.DELETE;
Line: 8962

            l_ctcv_tbl_out.DELETE;
Line: 8985

                OKC_CTC_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_ctcv_tbl            => l_ctcv_tbl_in,
                                        x_ctcv_tbl            => l_ctcv_tbl_out);
Line: 8995

                        LOG_MESSAGES('LINE_BILLING_CONTACT update status: '||l_return_status);
Line: 9012

                        LOG_MESSAGES('LINE_BILLING_CONTACT update status: '||l_return_status);
Line: 9013

                        LOG_MESSAGES('Line Billing Contact Update failed;'||l_message);
Line: 9059

              OKC_CONTRACT_PUB.update_contract_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_restricted_update   => 'F' ,
                                        p_chrv_rec            => l_chrv_rec_in,
                                        x_chrv_rec            => l_chrv_rec_out);
Line: 9070

                        LOG_MESSAGES('SHIP_TO_ADDRESS update status: '||l_return_status);
Line: 9087

                        LOG_MESSAGES('SHIP_TO_ADDRESS update status: '||l_return_status);
Line: 9088

                        LOG_MESSAGES('Ship-To Address Update failed;'||l_message);
Line: 9130

              OKC_CONTRACT_PUB.update_contract_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_restricted_update   => 'F' ,
                                        p_chrv_rec            => l_chrv_rec_in,
                                        x_chrv_rec            => l_chrv_rec_out);
Line: 9142

                        LOG_MESSAGES('PAYMENT_TERM update status: '||l_return_status);
Line: 9159

                        LOG_MESSAGES('PAYMENT_TERM update status: '||l_return_status);
Line: 9160

                        LOG_MESSAGES('PAYMENT_TERM Update failed;'||l_message);
Line: 9208

              OKC_CONTRACT_PUB.update_contract_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_restricted_update   => 'F' ,
                                        p_chrv_rec            => l_chrv_rec_in,
                                        x_chrv_rec            => l_chrv_rec_out);
Line: 9220

                        LOG_MESSAGES('CON_RENEWAL_TYPE update status: '||l_return_status);
Line: 9237

                        LOG_MESSAGES('CON_RENEWAL_TYPE update status: '||l_return_status);
Line: 9238

                        LOG_MESSAGES('CON_RENEWAL_TYPE Update failed;'||l_message);
Line: 9288

                OKS_CONTRACT_HDR_PUB.update_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_khrv_rec            => l_khrv_rec_type_in,
                                        x_khrv_rec            => l_khrv_rec_type_out,
                                        p_validate_yn         => 'Y');
Line: 9300

                        LOG_MESSAGES('CON_RENEWAL_TYPE  update status: '||l_return_status);
Line: 9317

                        LOG_MESSAGES('CON_RENEWAL_TYPE update status: '||l_return_status);
Line: 9318

                        LOG_MESSAGES('CON_RENEWAL_TYPE Update failed;'||l_message);
Line: 9365

                OKS_CONTRACT_HDR_PUB.update_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_khrv_rec            => l_khrv_rec_type_in,
                                        x_khrv_rec            => l_khrv_rec_type_out,
                                        p_validate_yn         => 'Y');
Line: 9377

                        LOG_MESSAGES('ACCT_RULE update status: '||l_return_status);
Line: 9394

                        LOG_MESSAGES('ACCT_RULE update status: '||l_return_status);
Line: 9395

                        LOG_MESSAGES('ACCT_RULE Update failed;'||l_message);
Line: 9442

                OKS_CONTRACT_HDR_PUB.update_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_khrv_rec            => l_khrv_rec_type_in,
                                        x_khrv_rec            => l_khrv_rec_type_out,
                                        p_validate_yn         => 'Y');
Line: 9454

                        LOG_MESSAGES('SUMMARY_PRINT update status: '||l_return_status);
Line: 9471

                        LOG_MESSAGES('SUMMARY_PRINT update status: '||l_return_status);
Line: 9472

                        LOG_MESSAGES('SUMMARY_PRINT Update failed;'||l_message);
Line: 9518

                OKS_CONTRACT_HDR_PUB.update_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_khrv_rec            => l_khrv_rec_type_in,
                                        x_khrv_rec            => l_khrv_rec_type_out,
                                        p_validate_yn         => 'Y');
Line: 9530

                        LOG_MESSAGES('PO Required update status: '||l_return_status);
Line: 9546

                        LOG_MESSAGES('PO Required update status: '||l_return_status);
Line: 9547

                        LOG_MESSAGES('PO Required Update failed;'||l_message);
Line: 9589

            OKC_CONTRACT_PUB.update_contract_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_restricted_update   => 'F' ,
                                        p_chrv_rec            => l_chrv_rec_in,
                                        x_chrv_rec            => l_chrv_rec_out);
Line: 9600

                 LOG_MESSAGES('INV_RULE update status: '||l_return_status);
Line: 9604

                       Update Okc_k_lines_b set inv_rule_id = l_new_value_id
                       Where id = rec_line_id.id;
Line: 9607

                        oks_bill_sch.update_bs_interface_date(
                                   p_top_line_id      => rec_line_id.id,
                                   p_invoice_rule_id  => l_new_value_id,
                                   x_return_status    => l_return_status,
                                   x_msg_count        => l_msg_count,
                                   x_msg_data         => l_msg_data);
Line: 9621

                           LOG_MESSAGES('INV_RULE update_bs_interface_date: '||l_return_status);
Line: 9637

                            LOG_MESSAGES('INV_RULE update_bs_interface_date: '||l_return_status);
Line: 9638

                            LOG_MESSAGES('INV_RULE update_bs_interface_date Update failed;'||l_message);
Line: 9657

                        LOG_MESSAGES('INV_RULE update status: '||l_return_status);
Line: 9658

                        LOG_MESSAGES('INV_RULE Update failed;'||l_message);
Line: 9684

    l_klnv_tbl_type_in.DELETE;
Line: 9706

                OKS_CONTRACT_LINE_PUB.update_line(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_klnv_tbl            => l_klnv_tbl_type_in,
                                        x_klnv_tbl            => l_klnv_tbl_type_out,
                                        p_validate_yn         => 'Y');
Line: 9717

                        LOG_MESSAGES('COV_TYPE update status: '||l_return_status);
Line: 9734

                        LOG_MESSAGES('COV_TYPE update status: '||l_return_status);
Line: 9735

                        LOG_MESSAGES('COV_TYPE Update failed;'||l_message);
Line: 9761

       l_clev_tbl_in.DELETE;
Line: 9762

       l_clev_tbl_out.DELETE;
Line: 9807

                 OKC_CONTRACT_PUB.update_contract_line(
                            	p_api_version		=> l_api_version,
                              	p_init_msg_list		=> l_init_msg_list,
                            	x_return_status		=> l_return_status,
                            	x_msg_count		=> l_msg_count,
                             	x_msg_data		=> l_msg_data,
                                p_clev_tbl              => l_clev_tbl_in,
                                x_clev_tbl              => l_clev_tbl_out);
Line: 9817

                        LOG_MESSAGES('BP Price List update status: '||l_return_status);
Line: 9834

                        LOG_MESSAGES('BP Price List update status: '||l_return_status);
Line: 9835

                        LOG_MESSAGES('BP Price List Update failed;'||l_message);
Line: 9862

         l_ctz_tblType_in.delete;
Line: 9863

         l_ctz_tblType_out.delete;
Line: 9922

              OKS_CTZ_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_oks_coverage_timezones_v_tbl            => l_ctz_tblType_in,
                                        x_oks_coverage_timezones_v_tbl            => l_ctz_tblType_out);
Line: 9933

                        LOG_MESSAGES('Coverage Timezone update status: '||l_return_status);
Line: 9948

                        LOG_MESSAGES('Coverage Timezone update status: '||l_return_status);
Line: 9949

                        LOG_MESSAGES('Coverage Timezone Update failed;'||l_message);
Line: 9974

            l_ctcv_tbl_in.DELETE;
Line: 9975

            l_ctcv_tbl_out.DELETE;
Line: 9999

                 OKC_CTC_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_ctcv_tbl            => l_ctcv_tbl_in,
                                        x_ctcv_tbl            => l_ctcv_tbl_out);
Line: 10009

                        LOG_MESSAGES('PREF_ENGG update status: '||l_return_status);
Line: 10026

                        LOG_MESSAGES('PREF_ENGG update status: '||l_return_status);
Line: 10027

                        LOG_MESSAGES('PREF_ENGG Update failed;'||l_message);
Line: 10053

            l_ctcv_tbl_in.DELETE;
Line: 10054

            l_ctcv_tbl_out.DELETE;
Line: 10076

                 OKC_CTC_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_ctcv_tbl            => l_ctcv_tbl_in,
                                        x_ctcv_tbl            => l_ctcv_tbl_out);
Line: 10086

                        LOG_MESSAGES('RES_GROUP update status: '||l_return_status);
Line: 10103

                        LOG_MESSAGES('RES_GROUP update status: '||l_return_status);
Line: 10104

                        LOG_MESSAGES('RES_GROUP Update failed;'||l_message);
Line: 10131

       l_gvev_tbl_in.DELETE;
Line: 10132

       l_gvev_tbl_out.DELETE;
Line: 10153

                OKC_GVE_PVT.update_row(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_gvev_tbl            => l_gvev_tbl_in,
                                        x_gvev_tbl            => l_gvev_tbl_out);
Line: 10163

                        LOG_MESSAGES('AGREEMENT_NAME update status: '||l_return_status);
Line: 10180

                        LOG_MESSAGES('AGREEMENT_NAME update status: '||l_return_status);
Line: 10181

                        LOG_MESSAGES('AGREEMENT_NAME Update failed;'||l_message);
Line: 10227

              OKC_CONTRACT_PUB.update_contract_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_restricted_update   => 'F' ,
                                        p_chrv_rec            => l_chrv_rec_in,
                                        x_chrv_rec            => l_chrv_rec_out);
Line: 10238

                        LOG_MESSAGES('BILL_TO_ADDRESS update status: '||l_return_status);
Line: 10255

                        LOG_MESSAGES('BILL_TO_ADDRESS update status: '||l_return_status);
Line: 10256

                        LOG_MESSAGES('Bill-To Address Update failed;'||l_message);
Line: 10324

              OKC_CONTRACT_PUB.update_contract_header(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_restricted_update   => 'F' ,
                                        p_chrv_rec            => l_chrv_rec_in,
                                        x_chrv_rec            => l_chrv_rec_out);
Line: 10335

                        LOG_MESSAGES('PRICE_LIST update status: '||l_return_status);
Line: 10413

                        LOG_MESSAGES('PRICE_LIST update status: '||l_return_status);
Line: 10414

                        LOG_MESSAGES('Price List Update failed;'||l_message);
Line: 10440

            l_cvt_tbl_in.DELETE;
Line: 10441

            l_cvt_tbl_out.DELETE;
Line: 10476

            OKS_CVT_PVT.update_row(     p_api_version                  => l_api_version,
                                        p_init_msg_list                => l_init_msg_list,
                                        x_return_status                => l_return_status,
                                        x_msg_count                    => l_msg_count,
                                        x_msg_data                     => l_msg_data,
                                        p_oks_coverage_times_v_tbl     => l_cvt_tbl_in,
                                        x_oks_coverage_times_v_tbl     => l_cvt_tbl_out);
Line: 10487

                    LOG_MESSAGES('COVERAGE_START_TIME update status: '||l_return_status);
Line: 10524

                             LOG_MESSAGES('Coverage Start Time Update failed;'||l_message);
Line: 10541

                    LOG_MESSAGES('COVERAGE_START_TIME update status: '||l_return_status);
Line: 10542

                    LOG_MESSAGES('Coverage Start Time Update failed;'||l_message);
Line: 10570

          l_cvt_tbl_in.DELETE;
Line: 10571

          l_cvt_tbl_out.DELETE;
Line: 10604

            OKS_CVT_PVT.update_row(     p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_oks_coverage_times_v_tbl	      => l_cvt_tbl_in,
                                        x_oks_coverage_times_v_tbl        => l_cvt_tbl_out);
Line: 10614

                    LOG_MESSAGES('COVERAGE_END_TIME update status: '||l_return_status);
Line: 10650

                             LOG_MESSAGES('Coverage End Time Update failed;'||l_message);
Line: 10667

                    LOG_MESSAGES('COVERAGE_END_TIME update status: '||l_return_status);
Line: 10668

                    LOG_MESSAGES('Coverage End Time Update failed;'||l_message);
Line: 10697

        l_act_tbl_in.delete;
Line: 10698

        l_act_tbl_out.delete;
Line: 10746

            OKS_ACM_PVT.update_row (
                        	p_api_version		=> l_api_version,
                          	p_init_msg_list		=> l_init_msg_list,
                        	x_return_status		=> l_return_status,
                        	x_msg_count			=> l_msg_count,
                         	x_msg_data			=> l_msg_data,
                        	p_oks_action_times_v_tbl		    => l_act_tbl_in,
    	                    x_oks_action_times_v_tbl		    => l_act_tbl_out );
Line: 10757

                     LOG_MESSAGES('Reaction update status: '||l_return_status);
Line: 10771

                LOG_MESSAGES('Reaction Time update status: '||l_return_status);
Line: 10772

                LOG_MESSAGES('Reaction Time Update failed;'||l_message);
Line: 10798

        l_act_tbl_in.delete;
Line: 10799

        l_act_tbl_out.delete;
Line: 10843

            OKS_ACM_PVT.update_row (
                        	p_api_version		=> l_api_version,
                          	p_init_msg_list		=> l_init_msg_list,
                        	x_return_status		=> l_return_status,
                        	x_msg_count			=> l_msg_count,
                         	x_msg_data			=> l_msg_data,
                        	p_oks_action_times_v_tbl		    => l_act_tbl_in,
    	                    x_oks_action_times_v_tbl		    => l_act_tbl_out );
Line: 10853

                     LOG_MESSAGES('Resolution update status: '||l_return_status);
Line: 10867

                LOG_MESSAGES('Resolution Time update status: '||l_return_status);
Line: 10868

                LOG_MESSAGES('Resolution Time Update failed;'||l_message);
Line: 10910

          OKC_CONTRACT_PUB.update_contract_header (
                        	p_api_version		=> l_api_version,
                          	p_init_msg_list		=> l_init_msg_list,
                        	x_return_status		=> l_return_status,
                        	x_msg_count			=> l_msg_count,
                         	x_msg_data			=> l_msg_data,
                        	p_chrv_rec		    => l_chrv_rec_in,
    	                    x_chrv_rec		    => l_chrv_rec_out );
Line: 10919

                     LOG_MESSAGES('CONTRACT_HEADER(Cognomen) update status: '||l_return_status);
Line: 10933

                LOG_MESSAGES('CONTRACT_HEADER(Cognomen) update status: '||l_return_status);
Line: 10934

                LOG_MESSAGES('Contract Header(Cognomen) Update failed;'||l_message);
Line: 10978

                       OKC_CONTRACT_PUB.update_contract_header (
                        	p_api_version		=> l_api_version,
                          	p_init_msg_list		=> l_init_msg_list,
                        	x_return_status		=> l_return_status,
                        	x_msg_count			=> l_msg_count,
                         	x_msg_data			=> l_msg_data,
                        	p_chrv_rec		    => l_chrv_rec_in,
    	                    x_chrv_rec		    => l_chrv_rec_out );
Line: 10987

                     LOG_MESSAGES('CONTRACT_HEADER(Cust PO Number) update status: '||l_return_status);
Line: 11001

                LOG_MESSAGES('CONTRACT_HEADER(Cust PO Number) update status: '||l_return_status);
Line: 11002

                LOG_MESSAGES('Contract Header(Cust PO Number) Update failed;'||l_message);
Line: 11026

                  l_clev_tbl_in.delete;
Line: 11027

                  LOG_MESSAGES('Fetching contract lines for update');
Line: 11036

                  LOG_MESSAGES('Locking contract lines for update');
Line: 11052

                 OKC_CONTRACT_PUB.update_contract_line(
                            	p_api_version		=> l_api_version,
                              	p_init_msg_list		=> l_init_msg_list,
                            	x_return_status		=> l_return_status,
                            	x_msg_count		    => l_msg_count,
                             	x_msg_data		    => l_msg_data,
                                p_clev_tbl          => l_clev_tbl_in,
                                x_clev_tbl          => l_clev_tbl_out);
Line: 11062

                     LOG_MESSAGES('PRODUCT_ALIAS update status: '||l_return_status);
Line: 11076

                LOG_MESSAGES('PRODUCT_ALIAS update status: '||l_return_status);
Line: 11077

                LOG_MESSAGES('PRODUCT_ALIAS Update failed;'||l_message);
Line: 11101

                  l_clev_tbl_in.delete;
Line: 11102

                  LOG_MESSAGES('Fetching contract lines for update');
Line: 11111

                  LOG_MESSAGES('Locking contract lines for update');
Line: 11128

                 OKC_CONTRACT_PUB.update_contract_line(
                            	p_api_version		=> l_api_version,
                              	p_init_msg_list		=> l_init_msg_list,
                            	x_return_status		=> l_return_status,
                            	x_msg_count		    => l_msg_count,
                             	x_msg_data		    => l_msg_data,
                                p_clev_tbl          => l_clev_tbl_in,
                                x_clev_tbl          => l_clev_tbl_out);
Line: 11138

                     LOG_MESSAGES('CONTRACT_LINE_REF update status: '||l_return_status);
Line: 11152

                LOG_MESSAGES('CONTRACT_LINE_REF(Cognomen) update status: '||l_return_status);
Line: 11153

                LOG_MESSAGES('CONTRACT_LINE_REF(Cognomen) Update failed;'||l_message);
Line: 11170

                LOG_MESSAGES('CONTRACT_LINE_REF(Cognomen) update status: '||l_return_status);
Line: 11171

                LOG_MESSAGES('CONTRACT_LINE_REF(Cognomen) Update failed;'||l_message);
Line: 11192

        OKC_CONTRACT_GROUP_PUB.update_contract_grpngs(
                                        p_api_version         => l_api_version,
                                        p_init_msg_list       => l_init_msg_list,
                                        x_return_status       => l_return_status,
                                        x_msg_count           => l_msg_count,
                                        x_msg_data            => l_msg_data,
                                        p_cgcv_rec            => l_cgcv_rec_in,
                                        x_cgcv_rec            => l_cgcv_rec_out);
Line: 11202

                     LOG_MESSAGES('CONTRACT_GROUP update status: '||l_return_status);
Line: 11217

                LOG_MESSAGES('CONTRACT_GROUP update status: '||l_return_status);
Line: 11218

                LOG_MESSAGES('Contract Group Update failed;'||l_message);
Line: 11224

            l_chrv_tbl_in.DELETE;
Line: 11265

             LOG_MESSAGES('Fetching contract lines for update');
Line: 11266

             l_clev_tbl_in.DELETE;
Line: 11275

                LOG_MESSAGES('Locking contract lines for update, lines count:'||l_clev_tbl_in.COUNT);
Line: 11304

             l_klnv_tbl_type_in.DELETE;
Line: 11316

	                LOG_MESSAGES('Locking oks contract lines for update, lines count:'||l_klnv_tbl_type_in.COUNT);
Line: 11360

               OKC_CONTRACT_PUB.update_contract_header (
                        	p_api_version	  => l_api_version,
                          	p_init_msg_list	  => l_init_msg_list,
                        	x_return_status	  => l_return_status,
                        	x_msg_count	  => l_msg_count,
                         	x_msg_data	  => l_msg_data,
                        	p_chrv_rec        => l_chrv_rec_in,
    	                        x_chrv_rec        => l_chrv_rec_out );
Line: 11370

                          LOG_MESSAGES('CONTRACT_HEADER(Start_Date) update status: '||l_return_status);
Line: 11384

                           LOG_MESSAGES('CONTRACT_HEADERS(Contract_Start_Date) update status: '||l_return_status);
Line: 11385

                           LOG_MESSAGES('Contract Header(Contract_Start_Date) Update failed;'||l_message);
Line: 11397

                     OKC_CONTRACT_PUB.update_contract_line(
                        	   p_api_version	=> l_api_version,
                             	   p_init_msg_list	=> l_init_msg_list,
                            	   x_return_status	=> l_return_status,
                            	   x_msg_count	        => l_msg_count,
                             	   x_msg_data	        => l_msg_data,
                                 p_clev_tbl           => l_clev_tbl_in,
                                 x_clev_tbl           => l_clev_tbl_out);
Line: 11408

                          LOG_MESSAGES('CONTRACT_HEADER_LINES(Start_Date) update status: '||l_return_status);
Line: 11415

                                oks_contract_line_pub.update_line
                                (p_api_version        => l_api_version,
                                 p_init_msg_list      => l_init_msg_list,
                                 x_return_status      => l_return_status,
                                 x_msg_count          => l_msg_count,
                                 x_msg_data           => l_msg_data,
                                 p_klnv_tbl           => l_klnv_tbl_type_in,
                                 x_klnv_tbl           => l_klnv_tbl_type_out,
                                 p_validate_yn        => 'N'
                                 );
Line: 11425

				         LOG_MESSAGES('CONTRACT_HEADER_OKS_LINES(Start_Date) update status: '||l_return_status);
Line: 11437

				                  LOG_MESSAGES('CONTRACT_OKS_LINES(Contract_Start_Date) update status: '||l_return_status);
Line: 11438

                                          LOG_MESSAGES('Contract oks Lines(Contract_Start_Date) Update failed;'||l_message);
Line: 11493

                           LOG_MESSAGES('CONTRACT_START_DATE Update_CONTRACT_LINES status: '||l_return_status||',msg_count:'||l_msg_count);
Line: 11506

                             LOG_MESSAGES('Contract Lines Update(CONTRACT_START_DATE) failed;'||l_message);
Line: 11582

         l_chrv_tbl_in.DELETE;
Line: 11624

             LOG_MESSAGES('Fetching contract lines for update');
Line: 11625

             l_clev_tbl_in.DELETE;
Line: 11634

                LOG_MESSAGES('Locking contract lines for update, lines count:'||l_clev_tbl_in.COUNT);
Line: 11663

             l_klnv_tbl_type_in.DELETE;
Line: 11675

	                LOG_MESSAGES('Locking oks contract lines for update, lines count:'||l_klnv_tbl_type_in.COUNT);
Line: 11719

               OKC_CONTRACT_PUB.update_contract_header (
                        	p_api_version	  => l_api_version,
                          	p_init_msg_list	  => l_init_msg_list,
                        	x_return_status	  => l_return_status,
                        	x_msg_count	  => l_msg_count,
                         	x_msg_data	  => l_msg_data,
                        	p_chrv_rec        => l_chrv_rec_in,
    	                        x_chrv_rec        => l_chrv_rec_out );
Line: 11729

                          LOG_MESSAGES('CONTRACT_HEADER(End_Date) update status: '||l_return_status);
Line: 11743

                           LOG_MESSAGES('CONTRACT_HEADERS(Contract_End_Date) update status: '||l_return_status);
Line: 11744

                           LOG_MESSAGES('Contract Header(Contract_End_Date) Update failed;'||l_message);
Line: 11756

                     OKC_CONTRACT_PUB.update_contract_line(
                        	   p_api_version	=> l_api_version,
                             	   p_init_msg_list	=> l_init_msg_list,
                            	   x_return_status	=> l_return_status,
                            	   x_msg_count	        => l_msg_count,
                             	   x_msg_data	        => l_msg_data,
                                 p_clev_tbl           => l_clev_tbl_in,
                                 x_clev_tbl           => l_clev_tbl_out);
Line: 11767

                          LOG_MESSAGES('CONTRACT_HEADER_LINES(End_Date) update status: '||l_return_status);
Line: 11774

                                oks_contract_line_pub.update_line
                                (p_api_version        => l_api_version,
                                 p_init_msg_list      => l_init_msg_list,
                                 x_return_status      => l_return_status,
                                 x_msg_count          => l_msg_count,
                                 x_msg_data           => l_msg_data,
                                 p_klnv_tbl           => l_klnv_tbl_type_in,
                                 x_klnv_tbl           => l_klnv_tbl_type_out,
                                 p_validate_yn        => 'N'
                                 );
Line: 11784

				         LOG_MESSAGES('CONTRACT_HEADER_OKS_LINES(End_Date) update status: '||l_return_status);
Line: 11796

				                  LOG_MESSAGES('CONTRACT_OKS_LINES(Contract_End_Date) update status: '||l_return_status);
Line: 11797

                                          LOG_MESSAGES('Contract oks Lines(Contract_End_Date) Update failed;'||l_message);
Line: 11852

                           LOG_MESSAGES('CONTRACT_End_DATE Update_CONTRACT_LINES status: '||l_return_status||',msg_count:'||l_msg_count);
Line: 11865

                             LOG_MESSAGES('Contract Lines Update(CONTRACT_End_DATE) failed;'||l_message);
Line: 11948

             l_msg_tbl.DELETE;
Line: 12029

         OKC_OPER_INST_PUB.Update_Operation_Line (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_olev_rec                     => l_olev_rec_in,
                                            x_olev_rec                     => l_olev_rec_out);
Line: 12045

         OKC_OPER_INST_PUB.Update_Operation_Line (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_olev_rec                     => l_olev_rec_in,
                                            x_olev_rec                     => l_olev_rec_out);
Line: 12060

         OKC_OPER_INST_PUB.Update_Operation_Line (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_olev_rec                     => l_olev_rec_in,
                                            x_olev_rec                     => l_olev_rec_out);
Line: 12098

         OKC_OPER_INST_PUB.Update_Operation_Line (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_olev_rec                     => l_olev_rec_in,
                                            x_olev_rec                     => l_olev_rec_out);
Line: 12125

       OKC_OPER_INST_PUB.Update_Operation_Line (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_olev_rec                     => l_olev_rec_in,
                                            x_olev_rec                     => l_olev_rec_out);
Line: 12163

       OKC_OPER_INST_PUB.Update_Operation_Line (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_olev_rec                     => l_olev_rec_in,
                                            x_olev_rec                     => l_olev_rec_out);
Line: 12241

      OKC_OPER_INST_PUB.Update_Operation_Line (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_olev_rec                     => l_olev_rec_in,
                                            x_olev_rec                     => l_olev_rec_out);
Line: 12250

       LOG_MESSAGES(' OKC_OPER_INST_PUB.Update_Operation_Line:  '||l_return_status);
Line: 12261

                LOG_MESSAGES('inel Update_Operation_Line: '||l_msg_data);
Line: 12270

     OKC_OPER_INST_PUB.Update_Operation_Instance (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_oiev_rec                     => l_oiev_rec_in,
                                            x_oiev_rec                     => l_oiev_rec_out);
Line: 12315

                                     ||':  '||l_update_level);
Line: 12318

                                     ||':  '|| l_update_level_value);
Line: 12435

         OKC_OPER_INST_PUB.Update_Operation_Instance (
                                            p_api_version                  => l_api_version,
                                            p_init_msg_list                => l_init_msg_list,
                                            x_return_status                => l_return_status,
                                            x_msg_count                    => l_msg_count,
                                            x_msg_data                     => l_msg_data,
                                            p_oiev_rec                     => l_oiev_rec_in,
                                            x_oiev_rec                     => l_oiev_rec_out);
Line: 12443

         LOG_MESSAGES('Update_Operation_instance status:'||l_return_status);
Line: 12478

 PROCEDURE UPDATE_CONTRACT(p_chrv_rec       IN  okc_contract_pub.chrv_rec_type,
                           x_return_status  OUT NOCOPY VARCHAR2) IS
 l_api_version		CONSTANT	NUMBER	:= 1.0;
Line: 12491

 LOG_MESSAGES(' UPDATEing Contract, header_id = ' ||p_chrv_rec.id);
Line: 12495

 okc_contract_pub.update_contract_header (
    	p_api_version		=> l_api_version,
    	p_init_msg_list		=> l_init_msg_list,
    	x_return_status		=> l_return_status,
    	x_msg_count		=> l_msg_count,
    	x_msg_data		=> l_msg_data,
    	p_chrv_rec		=> p_chrv_rec,
    	x_chrv_rec		=> l_chrv_rec_out );
Line: 12504

     LOG_MESSAGES('okc_contract_pub.update_contract_header l_return_status = ' || l_return_status);
Line: 12507

      LOG_MESSAGES('okc_contract_pub.update_contract_header l_msg_data = ' || l_msg_data);
Line: 12510

      LOG_MESSAGES('okc_contract_pub.update_contract_header l_msg_data = ' || l_msg_data);
Line: 12514

 END UPDATE_CONTRACT;
Line: 12561

  SELECT ID from OKC_CLASS_OPERATIONS_V
  WHERE OPN_CODE = 'MASS_CHANGE' and CLS_CODE = 'SERVICE';
Line: 12581

    l_oiev_tbl_in(1).object1_id1                     := p_oie_rec.update_level_value;
Line: 12583

    l_oiev_tbl_in(1).jtot_object1_code               := p_oie_rec.update_level;
Line: 12587

    l_oiev_tbl_in(1).last_updated_by                 := NULL ; --OKC_API.G_MISS_NUM;
Line: 12588

    l_oiev_tbl_in(1).last_update_date                := SYSDATE;
Line: 12589

    l_oiev_tbl_in(1).last_update_login               := NULL ; --OKC_API.G_MISS_NUM;
Line: 12644

    l_omrv_rec_in.last_update_date                := SYSDATE;
Line: 12645

    l_omrv_rec_in.last_update_login               := NULL ; --OKC_API.G_MISS_NUM;
Line: 12677

    l_mod_rec_in.last_updated_by                 := NULL ; --OKC_API.G_MISS_NUM;
Line: 12678

    l_mod_rec_in.last_update_date                := SYSDATE;
Line: 12697

      OKS_MOD_PVT.insert_row(  	p_api_version					=> l_api_version,
    	                        p_init_msg_list					=> l_init_msg_list,
    	                        x_return_status					=> l_return_status,
    	                        x_msg_count					    => l_msg_count,
    	                        x_msg_data					    => l_msg_data,
                                p_OksMschgOperationsDtlsVRec    => l_mod_rec_in,
                                XOksMschgOperationsDtlsVRec     => l_mod_rec_out);
Line: 12719

PROCEDURE UPDATE_OPERATION_INSTANCES (p_oie_rec  IN opr_instance_rec_type,
                                      p_mrd_rec  IN masschange_request_rec_type,
                                      x_return_status OUT NOCOPY Varchar2) is
------------------------------------------------------------------
---TAPI variables
------------------------------------------------------------------
  l_api_version		CONSTANT	NUMBER	:= 1.0;
Line: 12743

         SELECT id from okc_masschange_req_dtls_v
         WHERE  oie_id = p_oie_id;
Line: 12750

    l_oiev_tbl_in(1).object1_id1                     := p_oie_rec.update_level_value;
Line: 12751

    l_oiev_tbl_in(1).jtot_object1_code               := p_oie_rec.update_level;
Line: 12755

       OKC_OPER_INST_PUB.UPdate_Operation_Instance(
    	p_api_version					=> l_api_version,
    	p_init_msg_list					=> l_init_msg_list,
    	x_return_status					=> l_return_status,
    	x_msg_count					    => l_msg_count,
    	x_msg_data					    => l_msg_data,
    	p_oiev_rec					    => l_oiev_tbl_in(1),
    	x_oiev_rec					    => l_oiev_tbl_out(1));
Line: 12791

     OKC_OPER_INST_PUB.Update_Masschange_Dtls(
                            	p_api_version					=> l_api_version,
    	                        p_init_msg_list					=> l_init_msg_list,
    	                        x_return_status					=> l_return_status,
    	                        x_msg_count					    => l_msg_count,
    	                        x_msg_data					    => l_msg_data,
                                p_mrdv_rec                      => l_omrv_rec_in,
                                x_mrdv_rec                      => l_omrv_rec_out);
Line: 12807

       OKC_OPER_INST_PUB.UPdate_Operation_Instance(
    	p_api_version					=> l_api_version,
    	p_init_msg_list					=> l_init_msg_list,
    	x_return_status					=> l_return_status,
    	x_msg_count					    => l_msg_count,
    	x_msg_data					    => l_msg_data,
    	p_oiev_rec					    => l_oiev_tbl_in(1),
    	x_oiev_rec					    => l_oiev_tbl_out(1));
Line: 12823

END UPDATE_OPERATION_INSTANCES;
Line: 12825

PROCEDURE DELETE_OPERATION_INSTANCES (p_oie_rec  IN opr_instance_rec_type,
                                      x_return_status OUT NOCOPY Varchar2) is
------------------------------------------------------------------
---TAPI variables
------------------------------------------------------------------
  l_api_version		CONSTANT	NUMBER	:= 1.0;
Line: 12869

     OKC_OPER_INST_PUB.Delete_Masschange_Dtls(
                            	p_api_version					=> l_api_version,
    	                        p_init_msg_list					=> l_init_msg_list,
    	                        x_return_status					=> l_return_status,
    	                        x_msg_count					    => l_msg_count,
    	                        x_msg_data					    => l_msg_data,
                                p_mrdv_rec                      => l_omrv_rec_in);
Line: 12888

       OKC_OPER_INST_PUB.Delete_Operation_Instance(
    	p_api_version					=> l_api_version,
    	p_init_msg_list					=> l_init_msg_list,
    	x_return_status					=> l_return_status,
    	x_msg_count					    => l_msg_count,
    	x_msg_data					    => l_msg_data,
    	p_oiev_rec					    => l_oiev_tbl_in(1));
Line: 12906

END DELETE_OPERATION_INSTANCES;
Line: 12952

    l_omrv_rec_in.last_update_date                := SYSDATE;
Line: 12953

    l_omrv_rec_in.last_update_login               := NULL ; --OKC_API.G_MISS_NUM;
Line: 12984

    l_mod_rec_in.last_updated_by                 := NULL ; --OKC_API.G_MISS_NUM;
Line: 12985

    l_mod_rec_in.last_update_date                := SYSDATE;
Line: 13004

      OKS_MOD_PVT.insert_row(  	p_api_version					=> l_api_version,
    	                        p_init_msg_list					=> l_init_msg_list,
    	                        x_return_status					=> l_return_status,
    	                        x_msg_count					    => l_msg_count,
    	                        x_msg_data					    => l_msg_data,
                                p_OksMschgOperationsDtlsVRec    => l_mod_rec_in,
                                XOksMschgOperationsDtlsVRec     => l_mod_rec_out);
Line: 13058

    l_olev_tbl_in(i).select_yn                       := p_ole_tbl(j).select_yn;
Line: 13070

    l_olev_tbl_in(i).last_updated_by                 := NULL ; --OKC_API.G_MISS_NUM;
Line: 13071

    l_olev_tbl_in(i).last_update_date                := SYSDATE;
Line: 13072

    l_olev_tbl_in(i).last_update_login               := NULL ; --OKC_API.G_MISS_NUM;
Line: 13076

    l_olev_tbl_in(i).program_update_date             := NULL ; --OKC_API.G_MISS_DATE;
Line: 13103

PROCEDURE DELETE_OPERATION_LINES (p_oie_id IN Number,
                                  x_return_status OUT NOCOPY Varchar2) IS

----------------------------------------------------------------------------
---TAPI variables
----------------------------------------------------------------------------
  l_api_version		CONSTANT	NUMBER	:= 1.0;
Line: 13123

         SELECT ole.id ole_id,omr.id omr_id
         from OKC_OPERATION_LINES_V ole, OKC_MASSCHANGE_REQ_DTLS_V omr
         where ole.id = omr.ole_id
         AND   omr.oie_id IS NULL
         AND   ole.oie_id = p_oie_id;
Line: 13150

     OKC_OPER_INST_PUB.Delete_Masschange_Dtls (
    	p_api_version				=> l_api_version,
    	p_init_msg_list				=> l_init_msg_list,
    	x_return_status				=> l_return_status,
    	x_msg_count					=> l_msg_count,
    	x_msg_data					=> l_msg_data,
        p_mrdv_tbl                  => l_omrv_tbl_in);
Line: 13164

     OKC_OPER_INST_PUB.Delete_Operation_Line(
    	p_api_version				=> l_api_version,
    	p_init_msg_list				=> l_init_msg_list,
    	x_return_status				=> l_return_status,
    	x_msg_count					=> l_msg_count,
    	x_msg_data					=> l_msg_data,
    	p_olev_tbl					=> l_olev_tbl_in);
Line: 13183

END DELETE_OPERATION_LINES;
Line: 13185

PROCEDURE UPDATE_OPERATION_LINES(p_ole_id IN NUMBER,
                                 p_select_yn IN VARCHAR2,
                                 p_qa_check_yn IN VARCHAR2 ) IS

        l_api_version		CONSTANT	NUMBER	:= 1.0;
Line: 13207

     l_olev_tbl_in(1).select_yn := p_select_yn ;
Line: 13209

     OKC_OPER_INST_PUB.Update_Operation_Line(
        	p_api_version			 => l_api_version,
    	    p_init_msg_list			 => l_init_msg_list,
    	    x_return_status			 => l_return_status,
    	    x_msg_count			     => l_msg_count,
    	    x_msg_data			     => l_msg_data,
    	    p_olev_tbl			     => l_olev_tbl_in,
    	    x_olev_tbl		         => l_olev_tbl_out   );
Line: 13218

     LOG_MESSAGES('OKC_OPER_INST_PUB.Update_Operation_Line l_return_status = ' || l_return_status);
Line: 13221

        LOG_MESSAGES('OKC_OPER_INST_PUB.Update_Operation_Line l_msg_data = ' || l_msg_data);
Line: 13225

        LOG_MESSAGES('OKC_OPER_INST_PUB.Update_Operation_Line l_msg_data = ' || l_msg_data);
Line: 13230

        Select mcd.id , mcd.mrd_id into  p_mod_id ,p_mod_mrd_id
        from oks_mschg_operations_dtls mcd
        where mcd.ole_id = p_ole_id ;
Line: 13237

        OKS_MOD_PVT.Update_row(
           p_api_version                   => l_api_version,
           p_init_msg_list                 => l_init_msg_list,
           x_return_status                 => l_return_status,
           x_msg_count                     => l_msg_count,
           x_msg_data                      => l_msg_data,
           p_OksMschgOperationsDtlsVRec    => l_mod_tbl_in,
           XOksMschgOperationsDtlsVRec     => l_mod_tbl_out );
Line: 13261

 END UPDATE_OPERATION_LINES;
Line: 13273

             SELECT name
             FROM   okc_k_groups_v
             WHERE  id = p_id;
Line: 13277

             SELECT name
             FROM   okc_k_groups_v
             WHERE  id = p_id;
Line: 13288

	      SELECT  gcck.concatenated_segments
	      From gl_code_combinations_kfv  gcck
	        ,  HR_ALL_ORGANIZATION_UNITS HOU
	        ,  HR_ORGANIZATION_INFORMATION HOI2
	        ,  GL_LEDGERS GSOB
	      WHERE HOU.ORGANIZATION_ID = HOI2.ORGANIZATION_ID
	      AND ( HOI2.ORG_INFORMATION_CONTEXT || '') ='Accounting Information'
	      AND HOI2.ORG_INFORMATION1 = TO_CHAR(GSOB.LEDGER_ID)
	      AND gcck.code_combination_id = p_ccid
	      and GSOB.chart_of_accounts_id = gcck.chart_of_accounts_id
	      and HOU.organization_id  = p_organization_id
	      and GSOB.object_type_code = 'L'
	      AND nvl(GSOB.complete_flag, 'Y') = 'Y' ;
Line: 13304

              Select rep.name
              From okx_salesreps_v rep
              Where rep.id1     = p_id1
              and rep.org_id    = p_org_id ;
Line: 13310

              SELECT meaning
              FROM   oks_cov_types_v
              WHERE  code = p_attr_code ;
Line: 13314

              SELECT name
              FROM   okx_timezones_v
              WHERE  timezone_id = p_attr_code ;
Line: 13320

             SELECT EMP.FULL_NAME NAME
             FROM JTF_RS_RESOURCE_EXTNS RSC
                 ,FND_USER U
                 ,OKX_PER_ALL_PEOPLE_V EMP
             WHERE RSC.RESOURCE_ID  = p_attr_code
             AND RSC.CATEGORY = 'EMPLOYEE'
             AND EMP.PERSON_ID = RSC.SOURCE_ID
             AND U.USER_ID = RSC.USER_ID  ;
Line: 13333

              SELECT name
              FROM   oks_resource_groups_v
              WHERE  id1 = p_attr_code ;
Line: 13338

              SELECT description
              FROM   oks_billing_profiles_v
              WHERE  id = p_attr_code ;
Line: 13342

              SELECT name
              FROM   okx_agreements_v
              WHERE  agreement_id = p_attr_code ;
Line: 13347

               SELECT SUBSTRB(P.PERSON_LAST_NAME,1,50) || ', ' ||
                      SUBSTRB(P.PERSON_FIRST_NAME,1,40) NAME
               FROM HZ_CUST_ACCOUNT_ROLES CAR,
                    HZ_PARTIES P,
		    --NPALEPU
                    --29-JUN-2005
                    --TCA Project
                    --Replaced hz_party_relationships table with hz_relationships table
                    /* HZ_PARTY_RELATIONSHIPS PR, */
                    HZ_RELATIONSHIPS PR,
                    --END NPALEPU
                    HZ_ORG_CONTACTS OC
               WHERE CAR.ROLE_TYPE = 'CONTACT'
               AND PR.PARTY_ID = CAR.PARTY_ID
               AND PR.CONTENT_SOURCE_TYPE = 'USER_ENTERED'
               --NPALEPU
               --29-JUN-2005
               --TCA Project
               --Replaced pr.party_relationship_id column with pr.relationship_id column and added new conditions
               /* AND OC.PARTY_RELATIONSHIP_ID = PR.PARTY_RELATIONSHIP_ID */
               AND OC.PARTY_RELATIONSHIP_ID = PR.RELATIONSHIP_ID
               AND PR.SUBJECT_TABLE_NAME = 'HZ_PARTIES'
               AND PR.OBJECT_TABLE_NAME = 'HZ_PARTIES'
               AND PR.DIRECTIONAL_FLAG = 'F'
               --END NPALEPU
               AND P.PARTY_ID = PR.SUBJECT_ID
               --NPALEPU
               --29-JUN-2005
               --TCA Project
               --Replaced dates check with status check as the 'Begin_date' and 'End_date' columns of hz_cust_account_roles table are migrated to 'Status' column
               /* AND DECODE(SIGN(TRUNC(sysdate) -
                   TRUNC(NVL(car.begin_date,sysdate))),-1,'I', DECODE(SIGN(TRUNC(sysdate) -
                   TRUNC(NVL(car.end_date,sysdate))),1,'I','A')) = 'A' */
               AND car.status = 'A'
               --END NPALEPU
               AND EXISTS
                   (SELECT 'X'
                    FROM hz_cust_acct_sites_all cas
                    WHERE cas.cust_account_id = car.cust_account_id)
                    AND CAR.CUST_ACCOUNT_ROLE_ID = p_attr_code ;
Line: 13391

     	      Select meaning
              From fnd_lookups
              Where lookup_code = p_attr_id
              And lookup_type   = 'OKS_SC_YES_NO' ;
Line: 13397

     	      Select meaning
              From fnd_lookups
              Where lookup_code = p_attr_id
              And lookup_type   in( 'OKC_RENEWAL_TYPE','OKS_RENEWAL_TYPE') ;
Line: 13403

     	      Select name
              From okx_list_headers_v
              Where id1 = p_attr_id
              And list_type_code = 'PRL';
Line: 13416

             SELECT meaning FROM fnd_lookups
             WHERE lookup_type = 'OKS_MASS_CHANGE_ATTRIBUTE'
             AND   lookup_code = p_lookup_code;
Line: 13436

         SELECT MEANING
         FROM FND_LOOKUPS
         WHERE  LOOKUP_TYPE = p_type
           AND  LOOKUP_CODE = p_code ;
Line: 13459

             SELECT name FROM OKX_CUST_SITE_USES_V
             WHERE id1 = p_attr_id
             AND site_use_code = p_site_code
             AND  id2 = '#';
Line: 13887

         SELECT count(*) cnt FROM okc_class_operations_v
         WHERE opn_code = 'MASS_CHANGE'
         AND   cls_code = 'SERVICE';
Line: 13891

         SELECT nvl(max(id),0) + 1 from okc_class_operations_v;
Line: 13908

   INSERT INTO okc_class_operations(
     ID
    ,OPN_CODE
    ,CLS_CODE
    ,SEARCH_FUNCTION_ID
    ,DETAIL_FUNCTION_ID
    ,OBJECT_VERSION_NUMBER
    ,CREATED_BY
    ,CREATION_DATE
    ,LAST_UPDATED_BY
    ,LAST_UPDATE_DATE
    ,LAST_UPDATE_LOGIN
    --,SECURITY_GROUP_ID
    ,PDF_ID)
    values
    (l_opn_id
    ,'MASS_CHANGE'
    ,'SERVICE'
    ,NULL
    ,NULL
    ,10000
    ,1
    ,SYSDATE
    ,1
    ,SYSDATE
    ,0
    --,NULL
    ,NULL);
Line: 13943

PROCEDURE UPDATE_LINE_STATUS(p_oie_id IN Number) IS
 PRAGMA AUTONOMOUS_TRANSACTION;
Line: 13947

 UPDATE okc_operation_lines
 SET    process_flag = NULL
 WHERE  oie_id = p_oie_id
 AND    select_yn = 'Y'
 AND    process_flag in ('A','E');
Line: 13956

        LOG_MESSAGES('UPDATE_LINE_STATUS: '||SQLERRM);
Line: 13957

 END UPDATE_LINE_STATUS;
Line: 13959

 PROCEDURE UPDATE_QA_CHECK_YN_COL IS

 Cursor get_rec IS SELECT
                   mrd.id
                  ,mrd.oie_id
                  ,mrd.ole_id
                  ,mrd.attribute_name
                  ,mrd.old_value
                  ,mrd.new_value
                  ,mrd.object_version_number
                  ,mrd.created_by
                  ,mrd.creation_date
                  ,mrd.last_updated_by
                  ,mrd.last_update_date
                  ,mrd.last_update_login
                  ,mrd.security_group_id
                  ,okh.sts_code status_code
             FROM okc_masschange_req_dtls mrd,
                  okc_operation_lines opn,
                  okc_k_headers_b okh
             WHERE mrd.ole_id = opn.id(+)
             AND opn.subject_chr_id = okh.id(+) ;
Line: 14005

    l_mod_rec_in.last_updated_by                 := r1.last_updated_by ; --NULL ; --OKC_API.G_MISS_NUM;
Line: 14006

    l_mod_rec_in.last_update_date                := r1.last_update_date ; --SYSDATE;
Line: 14020

      OKS_MOD_PVT.insert_row(  	p_api_version					=> l_api_version,
    	                        p_init_msg_list					=> l_init_msg_list,
    	                        x_return_status					=> l_return_status,
    	                        x_msg_count					    => l_msg_count,
    	                        x_msg_data					    => l_msg_data,
                                p_OksMschgOperationsDtlsVRec    => l_mod_rec_in,
                                XOksMschgOperationsDtlsVRec     => l_mod_rec_out);
Line: 14030

 END UPDATE_QA_CHECK_YN_COL ;