DBA Data[Home] [Help]

APPS.OKC_CLE_PVT SQL Statements

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

Line: 100

  		select 'x'
                --npalepu 08-11-2005 modified for bug # 4691662.
                --Replaced table okc_k_headers_b with headers_All_b table
                /* from OKC_K_HEADERS_B */
                FROM OKC_K_HEADERS_ALL_B
                --end npalepu
  		where ID = p_clev_rec.chr_id;
Line: 183

  		select 'x'
  		from OKC_K_LINES_B
  		where ID = p_clev_rec.cle_id;
Line: 265

  		select 'x'
  		from OKC_LINE_STYLES_V
  		where ID = p_clev_rec.lse_id;
Line: 269

   SELECT 'x'
     FROM okc_k_lines_b
     WHERE chr_id = p_chr_id AND id<>Nvl(p_cle_id,-1) AND lse_id=61;
Line: 274

  SELECT access_level
  FROM okc_line_styles_v
  WHERE id = p_clev_rec.lse_id;
Line: 543

  		select 'x'
                --npalepu 08-11-2005 modified for bug # 4691662.
                --Replaced table okc_k_headers_b with headers_All_b table
                /* from OKC_K_HEADERS_B */
                FROM OKC_K_HEADERS_ALL_B
                --end npalepu
  		where ID = p_clev_rec.dnz_chr_id;
Line: 975

	SELECT 'x'
	 FROM Okc_Statuses_B
	 WHERE okc_statuses_b.code  = p_code;
Line: 1072

  		select 'x'
		from FND_CURRENCIES_VL
		where currency_code = p_clev_rec.currency_code
		and enabled_flag = 'Y'
		and sysdate between nvl(start_date_active,sysdate)
					 and nvl(end_date_active,sysdate);
Line: 1158

			SELECT START_DATE, END_DATE
                        --npalepu 08-11-2005 modified for bug # 4691662.
                        --Replaced table okc_k_headers_b with headers_All_b table
                        /* FROM OKC_K_HEADERS_B */
                        FROM OKC_K_HEADERS_ALL_B
                        --end npalepu
			WHERE ID = p_clev_rec.dnz_chr_id;
Line: 1168

			SELECT START_DATE, END_DATE
			FROM OKC_K_LINES_B
			WHERE ID = p_clev_rec.cle_id;
Line: 1286

			SELECT START_DATE, END_DATE
                        --npalepu 08-11-2005 modified for bug # 4691662.
                        --Replaced table okc_k_headers_b with headers_All_b table
                        /* FROM OKC_K_HEADERS_B */
                        FROM OKC_K_HEADERS_ALL_B
                        --end npalepu
			WHERE ID = p_clev_rec.dnz_chr_id;
Line: 1296

			SELECT START_DATE, END_DATE
			FROM OKC_K_LINES_B
			WHERE ID = p_clev_rec.cle_id;
Line: 1472

		select line_number
		from OKC_K_LINES_B
		where chr_id = p_chr_id;
Line: 1478

		select line_number
		from OKC_K_LINES_B
		where cle_id = p_cle_id;
Line: 1609

  		select 'x'
		from FND_CURRENCIES_VL
		where currency_code = p_clev_rec.currency_code_renewed
		and enabled_flag = 'Y'
		and sysdate between nvl(start_date_active,sysdate)
					 and nvl(end_date_active,sysdate);
Line: 2126

  		select 'x'
  		from QP_PRICE_LISTS_V
  		where PRICE_LIST_ID = p_clev_rec.price_list_id;
Line: 2138

select 'x'
from okx_list_headers_v
WHERE id1 = p_clev_rec.price_list_id
and ((  status = 'A' and p_clev_rec.pricing_date is null) OR
      (p_clev_rec.pricing_date is not null
       and p_clev_rec.pricing_date between
       nvl(start_date_active,p_clev_rec.pricing_date)
       and nvl(end_date_active,p_clev_rec.pricing_date)));
Line: 2224

  		select 'x'
  		from QP_PRICE_LIST_LINES_V
  		where PRICE_LIST_LINE_ID = p_clev_rec.price_list_line_id;
Line: 2234

  select 'x'
  from OKX_QP_LIST_LINES_V
  where ID1 = p_clev_rec.price_list_line_id;
Line: 2314

  		SELECT 'x'
  		FROM OKC_K_LINES_B
  		WHERE id = p_clev_rec.config_top_model_line_id
                AND CONFIG_ITEM_TYPE = 'TOP_MODEL_LINE';
Line: 2388

  		SELECT 'x'
  		FROM FND_LOOKUPS
  		WHERE LOOKUP_CODE = p_clev_rec.ph_pricing_type
                AND LOOKUP_TYPE='OKC_PH_LINE_PRICE_TYPE';
Line: 2461

  		SELECT 'x'
  		FROM FND_LOOKUPS
  		WHERE LOOKUP_CODE = p_clev_rec.ph_price_break_basis
                AND LOOKUP_TYPE='OKC_PH_PRICE_BREAK_BASIS';
Line: 2534

  		SELECT 'x'
  		FROM QP_LIST_HEADERS_B
  		WHERE LIST_HEADER_ID = p_clev_rec.ph_qp_reference_id;
Line: 2538

  		SELECT 'x'
  		FROM QP_LIST_LINES
  		WHERE LIST_LINE_ID = p_clev_rec.ph_qp_reference_id;
Line: 2794

/* The following delete and update statements are commented out */
/* as a quick workaround to fix the time-consuming table handler issue */
/* Eventually we'll need to turn them into a separate fix_language procedure */
/*

    DELETE FROM OKC_K_LINES_TL T
     WHERE NOT EXISTS (
        SELECT NULL
          FROM OKC_K_LINES_B B
         WHERE B.ID = T.ID
        );
Line: 2806

    UPDATE OKC_K_LINES_TL T SET (
        NAME,
        COMMENTS,
        ITEM_DESCRIPTION,
        OKE_BOE_DESCRIPTION,
        COGNOMEN,
        BLOCK23TEXT) = (SELECT
                                  B.NAME,
                                  B.COMMENTS,
                                  B.ITEM_DESCRIPTION,
				  B.OKE_BOE_DESCRIPTION,
				  B.COGNOMEN,
                                  B.BLOCK23TEXT
                                FROM OKC_K_LINES_TL B
                               WHERE B.ID = T.ID
                                 AND B.LANGUAGE = T.SOURCE_LANG)
      WHERE (
              T.ID,
              T.LANGUAGE)
          IN (SELECT
                  SUBT.ID,
                  SUBT.LANGUAGE
                FROM OKC_K_LINES_TL SUBB, OKC_K_LINES_TL SUBT
               WHERE SUBB.ID = SUBT.ID
                 AND SUBB.LANGUAGE = SUBT.SOURCE_LANG
                 AND (SUBB.NAME <> SUBT.NAME
                      OR SUBB.COMMENTS <> SUBT.COMMENTS
                      OR SUBB.ITEM_DESCRIPTION <> SUBT.ITEM_DESCRIPTION
                      OR SUBB.OKE_BOE_DESCRIPTION <> SUBT.OKE_BOE_DESCRIPTION
                      OR SUBB.COGNOMEN <> SUBT.COGNOMEN
                      OR SUBB.BLOCK23TEXT <> SUBT.BLOCK23TEXT
                      OR (SUBB.NAME IS NULL AND SUBT.NAME IS NOT NULL)
                      OR (SUBB.NAME IS NOT NULL AND SUBT.NAME IS NULL)
                      OR (SUBB.COMMENTS IS NULL AND SUBT.COMMENTS IS NOT NULL)
                      OR (SUBB.COMMENTS IS NOT NULL AND SUBT.COMMENTS IS NULL)
                      OR (SUBB.ITEM_DESCRIPTION IS NULL AND SUBT.ITEM_DESCRIPTION IS NOT NULL)
                      OR (SUBB.ITEM_DESCRIPTION IS NOT NULL AND SUBT.ITEM_DESCRIPTION IS NULL)
                      OR (SUBB.OKE_BOE_DESCRIPTION IS NULL AND SUBT.OKE_BOE_DESCRIPTION IS NOT NULL)
                      OR (SUBB.OKE_BOE_DESCRIPTION IS NOT NULL AND SUBT.OKE_BOE_DESCRIPTION IS NULL)
                      OR (SUBB.COGNOMEN IS NULL AND SUBT.COGNOMEN IS NOT NULL)
                      OR (SUBB.COGNOMEN IS NOT NULL AND SUBT.COGNOMEN IS NULL)
                      OR (SUBB.BLOCK23TEXT IS NULL AND SUBT.BLOCK23TEXT IS NOT NULL)
                      OR (SUBB.BLOCK23TEXT IS NOT NULL AND SUBT.BLOCK23TEXT IS NULL)
              ));
Line: 2851

/* Modifying Insert as per performance guidelines given in bug 3723874 */
    INSERT /*+ append parallel(tt) */ INTO OKC_K_LINES_TL tt(
        ID,
        LANGUAGE,
        SOURCE_LANG,
        SFWT_FLAG,
        NAME,
        COMMENTS,
        ITEM_DESCRIPTION,
        OKE_BOE_DESCRIPTION,
        COGNOMEN,
        BLOCK23TEXT,
        CREATED_BY,
        CREATION_DATE,
        LAST_UPDATED_BY,
        LAST_UPDATE_DATE,
        LAST_UPDATE_LOGIN)
      select /*+ parallel(v) parallel(t) use_nl(t)  */  v.* from
      (SELECT  /*+ no_merge ordered parallel(b) */
            B.ID,
            L.LANGUAGE_CODE,
            B.SOURCE_LANG,
            B.SFWT_FLAG,
            B.NAME,
            B.COMMENTS,
            B.ITEM_DESCRIPTION,
     	    B.OKE_BOE_DESCRIPTION,
     	    B.COGNOMEN,
            B.BLOCK23TEXT,
            B.CREATED_BY,
            B.CREATION_DATE,
            B.LAST_UPDATED_BY,
            B.LAST_UPDATE_DATE,
            B.LAST_UPDATE_LOGIN
        FROM OKC_K_LINES_TL B, FND_LANGUAGES L
       WHERE L.INSTALLED_FLAG IN ('I', 'B')
         AND B.LANGUAGE = USERENV('LANG')
	 ) v , OKC_K_LINES_TL t
         WHERE t.ID(+) = v.ID
         AND t.LANGUAGE(+) = v.LANGUAGE_CODE
	 AND t.id IS NULL;
Line: 2893

/* Commenting delete and update for bug 3723874 */
/*
    DELETE FROM OKC_K_LINES_TLH T
     WHERE NOT EXISTS (
        SELECT NULL
          FROM OKC_K_LINES_BH B
         WHERE B.ID = T.ID
         AND T.MAJOR_VERSION = B.MAJOR_VERSION
        );
Line: 2903

    UPDATE OKC_K_LINES_TLH T SET (
        NAME,
        COMMENTS,
        ITEM_DESCRIPTION,
        OKE_BOE_DESCRIPTION,
        COGNOMEN,
        BLOCK23TEXT) = (SELECT
                                  B.NAME,
                                  B.COMMENTS,
                                  B.ITEM_DESCRIPTION,
                                  B.OKE_BOE_DESCRIPTION,
                                  B.COGNOMEN,
                                  B.BLOCK23TEXT
                                FROM OKC_K_LINES_TLH B
                               WHERE B.ID = T.ID
                                AND B.MAJOR_VERSION = T.MAJOR_VERSION
                                 AND B.LANGUAGE = T.SOURCE_LANG)
      WHERE (
              T.ID,
              T.MAJOR_VERSION,
              T.LANGUAGE)
          IN (SELECT
                  SUBT.ID,
                  SUBT.MAJOR_VERSION,
                  SUBT.LANGUAGE
                FROM OKC_K_LINES_TLH SUBB, OKC_K_LINES_TLH SUBT
               WHERE SUBB.ID = SUBT.ID
                 AND SUBB.MAJOR_VERSION = SUBT.MAJOR_VERSION
                 AND SUBB.LANGUAGE = SUBT.SOURCE_LANG
                 AND (SUBB.NAME <> SUBT.NAME
                      OR SUBB.COMMENTS <> SUBT.COMMENTS
                      OR SUBB.ITEM_DESCRIPTION <> SUBT.ITEM_DESCRIPTION
                      OR SUBB.OKE_BOE_DESCRIPTION <> SUBT.OKE_BOE_DESCRIPTION
                      OR SUBB.COGNOMEN <> SUBT.COGNOMEN
                      OR SUBB.BLOCK23TEXT <> SUBT.BLOCK23TEXT
                      OR (SUBB.NAME IS NULL AND SUBT.NAME IS NOT NULL)
                      OR (SUBB.NAME IS NOT NULL AND SUBT.NAME IS NULL)
                      OR (SUBB.COMMENTS IS NULL AND SUBT.COMMENTS IS NOT NULL)
                      OR (SUBB.COMMENTS IS NOT NULL AND SUBT.COMMENTS IS NULL)
                      OR (SUBB.ITEM_DESCRIPTION IS NULL AND SUBT.ITEM_DESCRIPTION IS NOT NULL)
                      OR (SUBB.ITEM_DESCRIPTION IS NOT NULL AND SUBT.ITEM_DESCRIPTION IS NULL)
                      OR (SUBB.OKE_BOE_DESCRIPTION IS NULL AND SUBT.OKE_BOE_DESCRIPTION IS NOT NULL)
                      OR (SUBB.OKE_BOE_DESCRIPTION IS NOT NULL AND SUBT.OKE_BOE_DESCRIPTION IS NULL)
                      OR (SUBB.COGNOMEN IS NULL AND SUBT.COGNOMEN IS NOT NULL)
                      OR (SUBB.COGNOMEN IS NOT NULL AND SUBT.COGNOMEN IS NULL)
                      OR (SUBB.BLOCK23TEXT IS NULL AND SUBT.BLOCK23TEXT IS NOT NULL)
                      OR (SUBB.BLOCK23TEXT IS NOT NULL AND SUBT.BLOCK23TEXT IS NULL)
              ));
Line: 2952

/* Modifying Insert as per performance guidelines given in bug 3723874 */
    INSERT /*+ append parallel(tt) */ INTO OKC_K_LINES_TLH tt (
        ID,
        LANGUAGE,
        MAJOR_VERSION,
        SOURCE_LANG,
        SFWT_FLAG,
        NAME,
        COMMENTS,
        ITEM_DESCRIPTION,
        OKE_BOE_DESCRIPTION,
        COGNOMEN,
        BLOCK23TEXT,
        CREATED_BY,
        CREATION_DATE,
        LAST_UPDATED_BY,

        LAST_UPDATE_DATE,
        LAST_UPDATE_LOGIN)
      select /*+ parallel(v) parallel(t) use_nl(t)  */ v.* from
     ( SELECT /*+ no_merge ordered parallel(b) */
            B.ID,
            L.LANGUAGE_CODE,
            B.MAJOR_VERSION,
            B.SOURCE_LANG,
            B.SFWT_FLAG,
            B.NAME,
            B.COMMENTS,
            B.ITEM_DESCRIPTION,
            B.OKE_BOE_DESCRIPTION,
            B.COGNOMEN,
            B.BLOCK23TEXT,
            B.CREATED_BY,
            B.CREATION_DATE,
            B.LAST_UPDATED_BY,
            B.LAST_UPDATE_DATE,
            B.LAST_UPDATE_LOGIN
        FROM OKC_K_LINES_TLH B, FND_LANGUAGES L
       WHERE L.INSTALLED_FLAG IN ('I', 'B')
         AND B.LANGUAGE = USERENV('LANG')
	 ) v , OKC_K_LINES_TLH T
         WHERE T.ID(+) = v.ID
         AND T.LANGUAGE(+) = v.LANGUAGE_CODE
         AND T.MAJOR_VERSION(+) = v.MAJOR_VERSION
         AND t.id IS NULL;
Line: 3014

    SELECT
            ID,
            LINE_NUMBER,
            CHR_ID,
            CLE_ID,
            DNZ_CHR_ID,
            DISPLAY_SEQUENCE,
            STS_CODE,
            TRN_CODE,
            LSE_ID,
            EXCEPTION_YN,
            OBJECT_VERSION_NUMBER,
            CREATED_BY,
            CREATION_DATE,
            LAST_UPDATED_BY,
            LAST_UPDATE_DATE,
            HIDDEN_IND,
	    PRICE_UNIT,
	    PRICE_UNIT_PERCENT,
            PRICE_NEGOTIATED,
	    PRICE_NEGOTIATED_RENEWED,
            PRICE_LEVEL_IND,
            INVOICE_LINE_LEVEL_IND,
            DPAS_RATING,
            TEMPLATE_USED,
            PRICE_TYPE,
            CURRENCY_CODE,
	    CURRENCY_CODE_RENEWED,
            LAST_UPDATE_LOGIN,
            DATE_TERMINATED,
            START_DATE,
            END_DATE,
	    DATE_RENEWED,
            UPG_ORIG_SYSTEM_REF,
            UPG_ORIG_SYSTEM_REF_ID,
            ORIG_SYSTEM_SOURCE_CODE,
            ORIG_SYSTEM_ID1,
            ORIG_SYSTEM_REFERENCE1,
            REQUEST_ID,
            PROGRAM_APPLICATION_ID,
            PROGRAM_ID,
            PROGRAM_UPDATE_DATE,
            PRICE_LIST_ID,
            PRICING_DATE,
            PRICE_LIST_LINE_ID,
            LINE_LIST_PRICE,
            ITEM_TO_PRICE_YN,
            PRICE_BASIS_YN,
            CONFIG_HEADER_ID,
            CONFIG_REVISION_NUMBER,
            CONFIG_COMPLETE_YN,
            CONFIG_VALID_YN,
            CONFIG_TOP_MODEL_LINE_ID,
            CONFIG_ITEM_TYPE,
            CONFIG_ITEM_ID,
            ATTRIBUTE_CATEGORY,
            ATTRIBUTE1,
            ATTRIBUTE2,
            ATTRIBUTE3,
            ATTRIBUTE4,
            ATTRIBUTE5,
            ATTRIBUTE6,
            ATTRIBUTE7,
            ATTRIBUTE8,
            ATTRIBUTE9,
            ATTRIBUTE10,
            ATTRIBUTE11,
            ATTRIBUTE12,
            ATTRIBUTE13,
            ATTRIBUTE14,
            ATTRIBUTE15,
            SERVICE_ITEM_YN,
                      --new columns for price hold
            ph_pricing_type,
            ph_price_break_basis,
            ph_min_qty,
            ph_min_amt,
            ph_qp_reference_id,
            ph_value,
            ph_enforce_price_list_yn,
            ph_adjustment,
            ph_integrated_with_qp,
-- new colums to replace rules
            CUST_ACCT_ID,
            BILL_TO_SITE_USE_ID,
            INV_RULE_ID,
            LINE_RENEWAL_TYPE_CODE,
            SHIP_TO_SITE_USE_ID,
            PAYMENT_TERM_ID,
            --NPALEPU on 30-JUN-2005 added new column for Annualized Amounts project
            ANNUALIZED_FACTOR,
            --END NPALEPU-
	    DATE_CANCELLED,  -- New columns for Line Level Cancellation
	    --canc_reason_code,
	    TERM_CANCEL_SOURCE,
	    CANCELLED_AMOUNT,
	    payment_instruction_type  --added by mchoudha 22-JUL
      FROM Okc_K_Lines_B
     WHERE okc_k_lines_b.id     = p_id;
Line: 3139

              l_cle_rec.LAST_UPDATED_BY,
              l_cle_rec.LAST_UPDATE_DATE,
              l_cle_rec.HIDDEN_IND,
	      l_cle_rec.PRICE_UNIT,
	      l_cle_rec.PRICE_UNIT_PERCENT,
              l_cle_rec.PRICE_NEGOTIATED,
	      l_cle_rec.PRICE_NEGOTIATED_RENEWED,
              l_cle_rec.PRICE_LEVEL_IND,
              l_cle_rec.INVOICE_LINE_LEVEL_IND,
              l_cle_rec.DPAS_RATING,
              l_cle_rec.TEMPLATE_USED,
              l_cle_rec.PRICE_TYPE,
              l_cle_rec.CURRENCY_CODE,
	      l_cle_rec.CURRENCY_CODE_RENEWED,
              l_cle_rec.LAST_UPDATE_LOGIN,
              l_cle_rec.DATE_TERMINATED,
              l_cle_rec.START_DATE,
              l_cle_rec.END_DATE,
	      l_cle_rec.DATE_RENEWED,
              l_cle_rec.UPG_ORIG_SYSTEM_REF,
              l_cle_rec.UPG_ORIG_SYSTEM_REF_ID,
              l_cle_rec.ORIG_SYSTEM_SOURCE_CODE,
              l_cle_rec.ORIG_SYSTEM_ID1,
              l_cle_rec.ORIG_SYSTEM_REFERENCE1,
              l_cle_rec.REQUEST_ID,
              l_cle_rec.PROGRAM_APPLICATION_ID,
              l_cle_rec.PROGRAM_ID,
              l_cle_rec.PROGRAM_UPDATE_DATE,
              l_cle_rec.PRICE_LIST_ID,
              l_cle_rec.PRICING_DATE,
              l_cle_rec.PRICE_LIST_LINE_ID,
              l_cle_rec.LINE_LIST_PRICE,
              l_cle_rec.ITEM_TO_PRICE_YN,
              l_cle_rec.PRICE_BASIS_YN,
              l_cle_rec.CONFIG_HEADER_ID,
              l_cle_rec.CONFIG_REVISION_NUMBER,
              l_cle_rec.CONFIG_COMPLETE_YN,
              l_cle_rec.CONFIG_VALID_YN,
              l_cle_rec.CONFIG_TOP_MODEL_LINE_ID,
              l_cle_rec.CONFIG_ITEM_TYPE,
              l_cle_rec.CONFIG_ITEM_ID,
              l_cle_rec.ATTRIBUTE_CATEGORY,
              l_cle_rec.ATTRIBUTE1,
              l_cle_rec.ATTRIBUTE2,
              l_cle_rec.ATTRIBUTE3,
              l_cle_rec.ATTRIBUTE4,
              l_cle_rec.ATTRIBUTE5,
              l_cle_rec.ATTRIBUTE6,
              l_cle_rec.ATTRIBUTE7,
              l_cle_rec.ATTRIBUTE8,
              l_cle_rec.ATTRIBUTE9,
              l_cle_rec.ATTRIBUTE10,
              l_cle_rec.ATTRIBUTE11,
              l_cle_rec.ATTRIBUTE12,
              l_cle_rec.ATTRIBUTE13,
              l_cle_rec.ATTRIBUTE14,
              l_cle_rec.ATTRIBUTE15,
              l_cle_rec.SERVICE_ITEM_YN,
                      --new columns for price hold
              l_cle_rec.ph_pricing_type,
              l_cle_rec.ph_price_break_basis,
              l_cle_rec.ph_min_qty,
              l_cle_rec.ph_min_amt,
              l_cle_rec.ph_qp_reference_id,
              l_cle_rec.ph_value,
              l_cle_rec.ph_enforce_price_list_yn,
              l_cle_rec.ph_adjustment,
              l_cle_rec.ph_integrated_with_qp,
               -- new columns to  replace rules
              l_cle_rec.cust_acct_id,
              l_cle_rec.bill_to_site_use_id,
              l_cle_rec.inv_rule_id,
              l_cle_rec.line_renewal_type_code,
              l_cle_rec.ship_to_site_use_id,
              l_cle_rec.payment_term_id,
	      --NPALEPU on 24-JUN-2005 added new column for Annualized Amounts project
              l_cle_rec.annualized_factor,
              --END NPALEPU
	      l_cle_rec.date_cancelled,
	      --l_cle_rec.canc_reason_code,
	      l_cle_rec.term_cancel_source,
	      l_cle_rec.cancelled_amount,
	      l_cle_rec.payment_instruction_type;  --added by mchoudha 22-JUL
Line: 3252

    SELECT
            ID,
            LANGUAGE,
            SOURCE_LANG,
            SFWT_FLAG,
            NAME,
            COMMENTS,
            ITEM_DESCRIPTION,
	    OKE_BOE_DESCRIPTION,
            COGNOMEN,
            BLOCK23TEXT,
            CREATED_BY,
            CREATION_DATE,
            LAST_UPDATED_BY,
            LAST_UPDATE_DATE,
            LAST_UPDATE_LOGIN
      FROM Okc_K_Lines_Tl
     WHERE okc_k_lines_tl.id    = p_id
       AND okc_k_lines_tl.language = p_language;
Line: 3297

              l_okc_k_lines_tl_rec.LAST_UPDATED_BY,
              l_okc_k_lines_tl_rec.LAST_UPDATE_DATE,
              l_okc_k_lines_tl_rec.LAST_UPDATE_LOGIN;
Line: 3329

    SELECT
            ID,
            OBJECT_VERSION_NUMBER,
            SFWT_FLAG,
            CHR_ID,
            CLE_ID,
            LSE_ID,
            LINE_NUMBER,
            STS_CODE,
            DISPLAY_SEQUENCE,
            TRN_CODE,
            DNZ_CHR_ID,
            COMMENTS,
            ITEM_DESCRIPTION,
	    OKE_BOE_DESCRIPTION,
     	    COGNOMEN,
            HIDDEN_IND,
            PRICE_UNIT,
	    PRICE_UNIT_PERCENT,
            PRICE_NEGOTIATED,
	    PRICE_NEGOTIATED_RENEWED,
            PRICE_LEVEL_IND,
            INVOICE_LINE_LEVEL_IND,
            DPAS_RATING,
            BLOCK23TEXT,
            EXCEPTION_YN,
            TEMPLATE_USED,
            DATE_TERMINATED,
            NAME,
            START_DATE,
            END_DATE,
	    DATE_RENEWED,
            UPG_ORIG_SYSTEM_REF,
            UPG_ORIG_SYSTEM_REF_ID,
            ORIG_SYSTEM_SOURCE_CODE,
            ORIG_SYSTEM_ID1,
            ORIG_SYSTEM_REFERENCE1,
            REQUEST_ID,
            PROGRAM_APPLICATION_ID,
            PROGRAM_ID,
            PROGRAM_UPDATE_DATE,
            PRICE_LIST_ID,
            PRICING_DATE,
            PRICE_LIST_LINE_ID,
            LINE_LIST_PRICE,
            ITEM_TO_PRICE_YN,
            PRICE_BASIS_YN,
            CONFIG_HEADER_ID,
            CONFIG_REVISION_NUMBER,
            CONFIG_COMPLETE_YN,
            CONFIG_VALID_YN,
            CONFIG_TOP_MODEL_LINE_ID,
            CONFIG_ITEM_TYPE,
            CONFIG_ITEM_ID ,
            ATTRIBUTE_CATEGORY,
            ATTRIBUTE1,
            ATTRIBUTE2,
            ATTRIBUTE3,
            ATTRIBUTE4,
            ATTRIBUTE5,
            ATTRIBUTE6,
            ATTRIBUTE7,
            ATTRIBUTE8,
            ATTRIBUTE9,
            ATTRIBUTE10,
            ATTRIBUTE11,
            ATTRIBUTE12,
            ATTRIBUTE13,
            ATTRIBUTE14,
            ATTRIBUTE15,
            CREATED_BY,
            CREATION_DATE,
            LAST_UPDATED_BY,
            LAST_UPDATE_DATE,
            PRICE_TYPE,
            CURRENCY_CODE,
	       CURRENCY_CODE_RENEWED,
            LAST_UPDATE_LOGIN,
            SERVICE_ITEM_YN,
                      --new columns for price hold
            ph_pricing_type,
            ph_price_break_basis,
            ph_min_qty,
            ph_min_amt,
            ph_qp_reference_id,
            ph_value,
            ph_enforce_price_list_yn,
            ph_adjustment,
            ph_integrated_with_qp,
               --new columns to replace rules
            CUST_ACCT_ID,
            BILL_TO_SITE_USE_ID,
            INV_RULE_ID,
            LINE_RENEWAL_TYPE_CODE,
            SHIP_TO_SITE_USE_ID,
            PAYMENT_TERM_ID,
	    DATE_CANCELLED,
	    --CANC_REASON_CODE,
	    TERM_CANCEL_SOURCE,
	    CANCELLED_AMOUNT,
	    --added by mchoudha 22-JUL
            annualized_factor,
	    payment_instruction_type
     FROM Okc_K_Lines_V
     WHERE okc_k_lines_v.id     = p_id;
Line: 3486

              l_clev_rec.program_update_date,
              l_clev_rec.price_list_id,
              l_clev_rec.pricing_date,
              l_clev_rec.price_list_line_id,
              l_clev_rec.line_list_price,
              l_clev_rec.item_to_price_yn,
              l_clev_rec.price_basis_yn,
              l_clev_rec.config_header_id,
              l_clev_rec.config_revision_number,
              l_clev_rec.config_complete_yn,
              l_clev_rec.config_valid_yn,
              l_clev_rec.config_top_model_line_id,
              l_clev_rec.config_item_type,
              l_clev_rec.CONFIG_ITEM_ID ,
              l_clev_rec.ATTRIBUTE_CATEGORY,
              l_clev_rec.ATTRIBUTE1,
              l_clev_rec.ATTRIBUTE2,
              l_clev_rec.ATTRIBUTE3,
              l_clev_rec.ATTRIBUTE4,
              l_clev_rec.ATTRIBUTE5,
              l_clev_rec.ATTRIBUTE6,
              l_clev_rec.ATTRIBUTE7,
              l_clev_rec.ATTRIBUTE8,
              l_clev_rec.ATTRIBUTE9,
              l_clev_rec.ATTRIBUTE10,
              l_clev_rec.ATTRIBUTE11,
              l_clev_rec.ATTRIBUTE12,
              l_clev_rec.ATTRIBUTE13,
              l_clev_rec.ATTRIBUTE14,
              l_clev_rec.ATTRIBUTE15,
              l_clev_rec.CREATED_BY,
              l_clev_rec.CREATION_DATE,
              l_clev_rec.LAST_UPDATED_BY,
              l_clev_rec.LAST_UPDATE_DATE,
              l_clev_rec.PRICE_TYPE,
              l_clev_rec.CURRENCY_CODE,
	         l_clev_rec.CURRENCY_CODE_RENEWED,
              l_clev_rec.LAST_UPDATE_LOGIN,
              l_clev_rec.SERVICE_ITEM_YN,
       -- new columns for price hold
              l_clev_rec.ph_pricing_type,
              l_clev_rec.ph_price_break_basis,
              l_clev_rec.ph_min_qty,
              l_clev_rec.ph_min_amt,
              l_clev_rec.ph_qp_reference_id,
              l_clev_rec.ph_value,
              l_clev_rec.ph_enforce_price_list_yn,
              l_clev_rec.ph_adjustment,
              l_clev_rec.ph_integrated_with_qp,
       -- new columns to  replace rules
              l_clev_rec.cust_acct_id,
              l_clev_rec.bill_to_site_use_id,
              l_clev_rec.inv_rule_id,
              l_clev_rec.line_renewal_type_code,
              l_clev_rec.ship_to_site_use_id,
              l_clev_rec.payment_term_id,
	      l_clev_rec.date_cancelled,
	     --l_clev_rec.canc_reason_code,
	      l_clev_rec.term_cancel_source,
	      l_clev_rec.cancelled_amount,
              --added by mchoudha 22-JUL
             l_clev_rec.annualized_factor,
	     l_clev_rec.payment_instruction_type;
Line: 3697

    IF (l_clev_rec.program_update_date  = OKC_API.G_MISS_DATE) THEN
        l_clev_rec.program_update_date  := NULL;
Line: 3798

    IF (l_clev_rec.last_updated_by = OKC_API.G_MISS_NUM) THEN
      l_clev_rec.last_updated_by := NULL;
Line: 3801

    IF (l_clev_rec.last_update_date = OKC_API.G_MISS_DATE) THEN
      l_clev_rec.last_update_date := NULL;
Line: 3813

    IF (l_clev_rec.last_update_login = OKC_API.G_MISS_NUM) THEN
      l_clev_rec.last_update_login := NULL;
Line: 3912

    /* Select application_id from okc_k_headers_b */
    Select application_id from okc_k_headers_all_b
    --end npalepu
    Where id = p_clev_rec.dnz_chr_id;
Line: 4319

               SELECT END_DATE
               --npalepu 08-11-2005 modified for bug # 4691662.
               --Replaced table okc_k_headers_b with headers_All_b table
               /* FROM OKC_K_HEADERS_B */
               FROM OKC_K_HEADERS_ALL_B
               --end npalepu
               WHERE ID = p_clev_rec.dnz_chr_id;
Line: 4404

    p_to.last_updated_by := p_from.last_updated_by;
Line: 4405

    p_to.last_update_date := p_from.last_update_date;
Line: 4418

    p_to.last_update_login := p_from.last_update_login;
Line: 4431

    p_to.program_update_date       := p_from.program_update_date;
Line: 4514

    p_to.last_updated_by := p_from.last_updated_by;
Line: 4515

    p_to.last_update_date := p_from.last_update_date;
Line: 4528

    p_to.last_update_login := p_from.last_update_login;
Line: 4541

    p_to.program_update_date       := p_from.program_update_date;
Line: 4621

    p_to.last_updated_by := p_from.last_updated_by;
Line: 4622

    p_to.last_update_date := p_from.last_update_date;
Line: 4623

    p_to.last_update_login := p_from.last_update_login;
Line: 4644

    p_to.last_updated_by := p_from.last_updated_by;
Line: 4645

    p_to.last_update_date := p_from.last_update_date;
Line: 4646

    p_to.last_update_login := p_from.last_update_login;
Line: 4878

  PROCEDURE insert_row(
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_cle_rec                      IN cle_rec_type,
    x_cle_rec                      OUT NOCOPY cle_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 4887

    l_api_name                     CONSTANT VARCHAR2(30) := 'B_insert_row';
Line: 4909

       okc_debug.log('13400: Entered insert_row', 2);
Line: 4931

    INSERT INTO OKC_K_LINES_B(
        id,
        line_number,
        chr_id,
        cle_id,
        dnz_chr_id,
        display_sequence,
        sts_code,
        trn_code,
        lse_id,
        exception_yn,
        object_version_number,
        created_by,
        creation_date,
        last_updated_by,
        last_update_date,
        hidden_ind,
        price_unit,
    	price_unit_percent,
        price_negotiated,
        price_negotiated_renewed,
        price_level_ind,
        invoice_line_level_ind,
        dpas_rating,
        template_used,
        price_type,
        currency_code,
        currency_code_renewed,
        last_update_login,
        date_terminated,
        start_date,
        end_date,
	date_renewed,
        upg_orig_system_ref,
        upg_orig_system_ref_id,
        orig_system_source_code,
        orig_system_id1,
        orig_system_reference1,
        program_id,
        request_id,
        program_update_date,
        program_application_id,
        price_list_id,
        pricing_date,
        price_list_line_id,
        line_list_price,
        item_to_price_yn,
        price_basis_yn,
        config_header_id,
        config_revision_number,
        config_complete_yn,
        config_valid_yn,
        config_top_model_line_id,
        config_item_type,
---Bug.No.-1942374
        config_item_id,
---Bug.No.-1942374
        attribute_category,
        attribute1,
        attribute2,
        attribute3,
        attribute4,
        attribute5,
        attribute6,
        attribute7,
        attribute8,
        attribute9,
        attribute10,
        attribute11,
        attribute12,
        attribute13,
        attribute14,
        attribute15,
        service_item_yn,
                      --new columns for price hold
        ph_pricing_type,
        ph_price_break_basis,
        ph_min_qty,
        ph_min_amt,
        ph_qp_reference_id,
        ph_value,
        ph_enforce_price_list_yn,
        ph_adjustment,
        ph_integrated_with_qp,
	   --new columns to replace rules
	   cust_acct_id,
	   bill_to_site_use_id,
	   inv_rule_id,
	   line_renewal_type_code,
	   ship_to_site_use_id,
	   payment_term_id,
	   payment_instruction_type, --added by mchoudha 22-JUL
	   ---NPALEPU on 03-JUN-2005 Added new column for Annualized Amount
        annualized_factor,
	/*** R12 Data Model Changes Start  **/
           date_cancelled		  ,
         -- canc_reason_code		  ,
           term_cancel_source		,
	   cancelled_amount
/** 	R12 Data Model Changes End ***/
	)
      VALUES (
        l_cle_rec.id,
        l_cle_rec.line_number,
        l_cle_rec.chr_id,
        l_cle_rec.cle_id,
        l_cle_rec.dnz_chr_id,
        l_cle_rec.display_sequence,
        l_cle_rec.sts_code,
        l_cle_rec.trn_code,
        l_cle_rec.lse_id,
        l_cle_rec.exception_yn,
        l_cle_rec.object_version_number,
        l_cle_rec.created_by,
        l_cle_rec.creation_date,
        l_cle_rec.last_updated_by,
        l_cle_rec.last_update_date,
        l_cle_rec.hidden_ind,
    	l_cle_rec.price_unit,
    	l_cle_rec.price_unit_percent,
        l_cle_rec.price_negotiated,
        l_cle_rec.price_negotiated_renewed,
        l_cle_rec.price_level_ind,
        l_cle_rec.invoice_line_level_ind,
        l_cle_rec.dpas_rating,
        l_cle_rec.template_used,
        l_cle_rec.price_type,
        l_cle_rec.currency_code,
	l_cle_rec.currency_code_renewed,
        l_cle_rec.last_update_login,
        l_cle_rec.date_terminated,
        l_cle_rec.start_date,
        l_cle_rec.end_date,
        l_cle_rec.date_renewed,
        l_cle_rec.upg_orig_system_ref,
        l_cle_rec.upg_orig_system_ref_id,
        l_cle_rec.orig_system_source_code,
        l_cle_rec.orig_system_id1,
        l_cle_rec.orig_system_reference1,
decode(FND_GLOBAL.CONC_PROGRAM_ID,-1,NULL,FND_GLOBAL.CONC_PROGRAM_ID),
decode(FND_GLOBAL.CONC_REQUEST_ID,-1,NULL,FND_GLOBAL.CONC_REQUEST_ID),
decode(FND_GLOBAL.CONC_REQUEST_ID,-1,NULL,SYSDATE),
decode(FND_GLOBAL.PROG_APPL_ID,-1,NULL,FND_GLOBAL.PROG_APPL_ID),
        l_cle_rec.price_list_id,
        l_cle_rec.pricing_date,
        l_cle_rec.price_list_line_id,
        l_cle_rec.line_list_price,
        l_cle_rec.item_to_price_yn,
        l_cle_rec.price_basis_yn,
        l_cle_rec.config_header_id,
        l_cle_rec.config_revision_number,
        l_cle_rec.config_complete_yn,
        l_cle_rec.config_valid_yn,
        l_cle_rec.config_top_model_line_id,
        l_cle_rec.config_item_type,
---Bug.No.-1942374
        l_cle_rec.config_item_id,
---Bug.No.-1942374
        l_cle_rec.attribute_category,
        l_cle_rec.attribute1,
        l_cle_rec.attribute2,
        l_cle_rec.attribute3,
        l_cle_rec.attribute4,
        l_cle_rec.attribute5,
        l_cle_rec.attribute6,
        l_cle_rec.attribute7,
        l_cle_rec.attribute8,
        l_cle_rec.attribute9,
        l_cle_rec.attribute10,
        l_cle_rec.attribute11,
        l_cle_rec.attribute12,
        l_cle_rec.attribute13,
        l_cle_rec.attribute14,
        l_cle_rec.attribute15,
        l_cle_rec.service_item_yn,
                  -- new columns for price hold
        l_cle_rec.ph_pricing_type,
        l_cle_rec.ph_price_break_basis,
        l_cle_rec.ph_min_qty,
        l_cle_rec.ph_min_amt,
        l_cle_rec.ph_qp_reference_id,
        l_cle_rec.ph_value,
        l_cle_rec.ph_enforce_price_list_yn,
        l_cle_rec.ph_adjustment,
        l_cle_rec.ph_integrated_with_qp,
--new columns to replace rules
        l_cle_rec.cust_acct_id,
        l_cle_rec.bill_to_site_use_id,
        l_cle_rec.inv_rule_id,
        l_cle_rec.line_renewal_type_code,
        l_cle_rec.ship_to_site_use_id,
        l_cle_rec.payment_term_id,
	l_cle_rec.payment_instruction_type, --added by mchoudha 22-JUL
        --NPALEPU on 03-JUN-2005 Added new column for Annualized Amounts
        NVL((SELECT (ADD_MONTHS(l_cle_rec.start_date, (nyears+1)*12) - l_cle_rec.start_date -
                    DECODE(ADD_MONTHS(l_cle_rec.end_date, -12),( l_cle_rec.end_date-366), 0,
                    DECODE(ADD_MONTHS(l_cle_rec.start_date, (nyears+1)*12) -
                    ADD_MONTHS(l_cle_rec.start_date, nyears*12), 366, 1, 0)))
                    / (nyears+1) /(l_cle_rec.end_date-l_cle_rec.start_date+1)
             FROM (SELECT trunc(MONTHS_BETWEEN(l_cle_rec.end_date, l_cle_rec.start_date)/12) nyears FROM dual)  dual
             WHERE l_cle_rec.lse_id in (1,12,14,19,46,7,8,9,10,11,13,18,25,35)),0),
       /*** R12 Data Model Changes Start  **/
        l_cle_rec.date_cancelled		  ,
        --l_cle_rec.canc_reason_code		  ,
        l_cle_rec.term_cancel_source		  ,
	l_cle_rec.cancelled_amount
/** 	R12 Data Model Changes End ***/
	);
Line: 5145

    okc_debug.log('13500: Exiting insert_row', 2);
Line: 5153

       okc_debug.log('13600: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 5169

       okc_debug.log('13700: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 5185

       okc_debug.log('13800: Exiting insert_row:OTHERS Exception', 2);
Line: 5199

  END insert_row;
Line: 5203

  PROCEDURE insert_row(
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_okc_k_lines_tl_rec           IN okc_k_lines_tl_rec_type,
    x_okc_k_lines_tl_rec           OUT NOCOPY okc_k_lines_tl_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 5212

    l_api_name                     CONSTANT VARCHAR2(30) := 'TL_insert_row';
Line: 5217

      SELECT *
        FROM FND_LANGUAGES
       WHERE INSTALLED_FLAG IN ('I', 'B');
Line: 5241

       okc_debug.log('14000: Entered insert_row', 2);
Line: 5265

      INSERT INTO OKC_K_LINES_TL(
          id,
          language,
          source_lang,
          sfwt_flag,
          name,
          comments,
          item_description,
          oke_boe_description,
          cognomen,
          block23text,
          created_by,
          creation_date,
          last_updated_by,
          last_update_date,
          last_update_login)
        VALUES (
          l_okc_k_lines_tl_rec.id,
          l_okc_k_lines_tl_rec.language,
          l_okc_k_lines_tl_rec.source_lang,
          l_okc_k_lines_tl_rec.sfwt_flag,
          l_okc_k_lines_tl_rec.name,
          l_okc_k_lines_tl_rec.comments,
          l_okc_k_lines_tl_rec.item_description,
	  l_okc_k_lines_tl_rec.oke_boe_description,
	  l_okc_k_lines_tl_rec.cognomen,
          l_okc_k_lines_tl_rec.block23text,
          l_okc_k_lines_tl_rec.created_by,
          l_okc_k_lines_tl_rec.creation_date,
          l_okc_k_lines_tl_rec.last_updated_by,
          l_okc_k_lines_tl_rec.last_update_date,
          l_okc_k_lines_tl_rec.last_update_login);
Line: 5303

    okc_debug.log('14100: Exiting insert_row', 2);
Line: 5311

       okc_debug.log('14200: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 5327

       okc_debug.log('14300: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 5343

       okc_debug.log('14400: Exiting insert_row:OTHERS Exception', 2);
Line: 5357

  END insert_row;
Line: 5361

  PROCEDURE insert_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_clev_rec                     IN clev_rec_type,
    x_clev_rec                     OUT NOCOPY clev_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 5371

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_insert_row';
Line: 5390

      l_clev_rec.LAST_UPDATE_DATE := l_clev_rec.CREATION_DATE;
Line: 5391

      l_clev_rec.LAST_UPDATED_BY := FND_GLOBAL.USER_ID;
Line: 5392

      l_clev_rec.LAST_UPDATE_LOGIN := FND_GLOBAL.LOGIN_ID;
Line: 5434

       okc_debug.log('14700: Entered insert_row', 2);
Line: 5504

    insert_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
      l_cle_rec,
      lx_cle_rec
    );
Line: 5518

    insert_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
      l_okc_k_lines_tl_rec,
      lx_okc_k_lines_tl_rec
    );
Line: 5538

    okc_debug.log('14800: Exiting insert_row', 2);
Line: 5546

       okc_debug.log('14900: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 5562

       okc_debug.log('15000: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 5578

       okc_debug.log('15100: Exiting insert_row:OTHERS Exception', 2);
Line: 5592

  END insert_row;
Line: 5596

  PROCEDURE insert_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_clev_tbl                     IN clev_tbl_type,
    x_clev_tbl                     OUT NOCOPY clev_tbl_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 5606

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_tbl_insert_row';
Line: 5614

       okc_debug.log('15200: Entered insert_row', 2);
Line: 5622

        insert_row (
          p_api_version                  => p_api_version,
          p_init_msg_list                => OKC_API.G_FALSE,
          x_return_status                => x_return_status,
          x_msg_count                    => x_msg_count,
          x_msg_data                     => x_msg_data,
          p_clev_rec                     => p_clev_tbl(i),
          x_clev_rec                     => x_clev_tbl(i));
Line: 5646

    okc_debug.log('15300: Exiting insert_row', 2);
Line: 5654

       okc_debug.log('15400: Exiting insert_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 5670

       okc_debug.log('15500: Exiting insert_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 5686

       okc_debug.log('15600: Exiting insert_row:OTHERS Exception', 2);
Line: 5700

  END insert_row;
Line: 5718

    SELECT OBJECT_VERSION_NUMBER
      FROM OKC_K_LINES_B
     WHERE ID = p_cle_rec.id
       AND OBJECT_VERSION_NUMBER = p_cle_rec.object_version_number
    FOR UPDATE OF OBJECT_VERSION_NUMBER NOWAIT;
Line: 5725

    SELECT OBJECT_VERSION_NUMBER
      FROM OKC_K_LINES_B
    WHERE ID = p_cle_rec.id;
Line: 5790

      OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
Line: 5799

      OKC_API.set_message(G_APP_NAME,G_RECORD_LOGICALLY_DELETED);
Line: 5873

    SELECT *
      FROM OKC_K_LINES_TL
     WHERE ID = p_okc_k_lines_tl_rec.id
    FOR UPDATE NOWAIT;
Line: 5933

      OKC_API.set_message(G_FND_APP,G_FORM_RECORD_DELETED);
Line: 6232

  PROCEDURE update_row(
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_restricted_update            IN VARCHAR2,
    p_cle_rec                      IN cle_rec_type,
    x_cle_rec                      OUT NOCOPY cle_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 6242

    l_api_name                     CONSTANT VARCHAR2(30) := 'B_update_row';
Line: 6322

      IF (x_cle_rec.last_updated_by = OKC_API.G_MISS_NUM)
      THEN
        x_cle_rec.last_updated_by := l_cle_rec.last_updated_by;
Line: 6326

      IF (x_cle_rec.last_update_date = OKC_API.G_MISS_DATE)
      THEN
        x_cle_rec.last_update_date := l_cle_rec.last_update_date;
Line: 6378

      IF (x_cle_rec.last_update_login = OKC_API.G_MISS_NUM)
      THEN
        x_cle_rec.last_update_login := l_cle_rec.last_update_login;
Line: 6400

             SELECT (ADD_MONTHS(x_cle_rec.start_date, (nyears+1)*12) - x_cle_rec.start_date -
                     DECODE(ADD_MONTHS(x_cle_rec.end_date, -12),( x_cle_rec.end_date-366), 0,
                     DECODE(ADD_MONTHS(x_cle_rec.start_date, (nyears+1)*12) - ADD_MONTHS(x_cle_rec.start_date, nyears*12), 366, 1, 0)))
                     / (nyears+1) /(x_cle_rec.end_date-x_cle_rec.start_date+1)
             INTO    x_cle_rec.annualized_factor
             FROM  (SELECT trunc(MONTHS_BETWEEN(x_cle_rec.end_date, x_cle_rec.start_date)/12) nyears FROM dual)  dual ;
Line: 6462

      IF (x_cle_rec.program_update_date  = OKC_API.G_MISS_DATE)
      THEN
        x_cle_rec.program_update_date  := l_cle_rec.program_update_date ;
Line: 6677

       okc_debug.log('18500: Entered update_row', 2);
Line: 6706

      UPDATE  OKC_K_LINES_B
      SET LINE_NUMBER = l_def_cle_rec.line_number,
        CHR_ID = l_def_cle_rec.chr_id,
        CLE_ID = l_def_cle_rec.cle_id,
        DNZ_CHR_ID = l_def_cle_rec.dnz_chr_id,
        DISPLAY_SEQUENCE = l_def_cle_rec.display_sequence,
        STS_CODE = l_def_cle_rec.sts_code,
        TRN_CODE = l_def_cle_rec.trn_code,
        LSE_ID = l_def_cle_rec.lse_id,
        EXCEPTION_YN = l_def_cle_rec.exception_yn,
        OBJECT_VERSION_NUMBER = l_def_cle_rec.object_version_number,
        --CREATED_BY = l_def_cle_rec.created_by,                                     /*Commented for bug 14499300 */
        --CREATION_DATE = l_def_cle_rec.creation_date,
        LAST_UPDATED_BY = l_def_cle_rec.last_updated_by,
        LAST_UPDATE_DATE = l_def_cle_rec.last_update_date,
        HIDDEN_IND = l_def_cle_rec.hidden_ind,
    	PRICE_UNIT = l_def_cle_rec.price_unit,
    	PRICE_UNIT_PERCENT = l_def_cle_rec.price_unit_percent,
        PRICE_NEGOTIATED = l_def_cle_rec.price_negotiated,
        PRICE_NEGOTIATED_RENEWED = l_def_cle_rec.price_negotiated_renewed,
        PRICE_LEVEL_IND = l_def_cle_rec.price_level_ind,
        INVOICE_LINE_LEVEL_IND = l_def_cle_rec.invoice_line_level_ind,
        DPAS_RATING = l_def_cle_rec.dpas_rating,
        TEMPLATE_USED = l_def_cle_rec.template_used,
        PRICE_TYPE = l_def_cle_rec.price_type,
        CURRENCY_CODE = l_def_cle_rec.currency_code,
	CURRENCY_CODE_RENEWED = l_def_cle_rec.currency_code_renewed,
        LAST_UPDATE_LOGIN = l_def_cle_rec.last_update_login,
        DATE_TERMINATED = l_def_cle_rec.date_terminated,
        START_DATE = l_def_cle_rec.start_date,
        END_DATE = l_def_cle_rec.end_date,
	DATE_RENEWED = l_def_cle_rec.date_renewed,
        UPG_ORIG_SYSTEM_REF = l_def_cle_rec.upg_orig_system_ref,
        UPG_ORIG_SYSTEM_REF_ID = l_def_cle_rec.upg_orig_system_ref_id,
        ORIG_SYSTEM_SOURCE_CODE = l_def_cle_rec.orig_system_source_code,
        ORIG_SYSTEM_ID1         = l_def_cle_rec.orig_system_id1,
        ORIG_SYSTEM_REFERENCE1  = l_def_cle_rec.orig_system_reference1,
        PROGRAM_ID = NVL(decode(FND_GLOBAL.CONC_PROGRAM_ID,-1,NULL,FND_GLOBAL.CONC_PROGRAM_ID),l_def_cle_rec.program_id),
        REQUEST_ID = NVL(decode(FND_GLOBAL.CONC_REQUEST_ID,-1,NULL,FND_GLOBAL.CONC_REQUEST_ID),l_def_cle_rec.request_id),
        PROGRAM_UPDATE_DATE = decode(decode(FND_GLOBAL.CONC_REQUEST_ID,-1,NULL,SYSDATE),NULL,l_def_cle_rec.program_update_date,SYSDATE),
        PROGRAM_APPLICATION_ID = NVL(decode(FND_GLOBAL.PROG_APPL_ID,-1,NULL,FND_GLOBAL.PROG_APPL_ID),l_def_cle_rec.program_application_id),
        PRICE_LIST_ID 	          =  l_def_cle_rec.PRICE_LIST_ID,
        PRICING_DATE 	          =  l_def_cle_rec.PRICING_DATE,
        PRICE_LIST_LINE_ID 	  =  l_def_cle_rec.PRICE_LIST_LINE_ID,
        LINE_LIST_PRICE 	  =  l_def_cle_rec.LINE_LIST_PRICE,
        ITEM_TO_PRICE_YN 	  =  l_def_cle_rec.ITEM_TO_PRICE_YN,
        PRICE_BASIS_YN 	          =  l_def_cle_rec.PRICE_BASIS_YN,
        CONFIG_HEADER_ID 	  =  l_def_cle_rec.CONFIG_HEADER_ID,
        CONFIG_REVISION_NUMBER 	  =  l_def_cle_rec.CONFIG_REVISION_NUMBER,
        CONFIG_COMPLETE_YN 	  =  l_def_cle_rec.CONFIG_COMPLETE_YN,
        CONFIG_VALID_YN 	  =  l_def_cle_rec.CONFIG_VALID_YN,
        CONFIG_TOP_MODEL_LINE_ID  =  l_def_cle_rec.CONFIG_TOP_MODEL_LINE_ID,
        CONFIG_ITEM_TYPE          =  l_def_cle_rec.CONFIG_ITEM_TYPE,
        CONFIG_ITEM_ID            =  l_def_cle_rec.CONFIG_ITEM_ID,
        ATTRIBUTE_CATEGORY = l_def_cle_rec.attribute_category,
        ATTRIBUTE1 = l_def_cle_rec.attribute1,
        ATTRIBUTE2 = l_def_cle_rec.attribute2,
        ATTRIBUTE3 = l_def_cle_rec.attribute3,
        ATTRIBUTE4 = l_def_cle_rec.attribute4,
        ATTRIBUTE5 = l_def_cle_rec.attribute5,
        ATTRIBUTE6 = l_def_cle_rec.attribute6,
        ATTRIBUTE7 = l_def_cle_rec.attribute7,
        ATTRIBUTE8 = l_def_cle_rec.attribute8,
        ATTRIBUTE9 = l_def_cle_rec.attribute9,
        ATTRIBUTE10 = l_def_cle_rec.attribute10,
        ATTRIBUTE11 = l_def_cle_rec.attribute11,
        ATTRIBUTE12 = l_def_cle_rec.attribute12,
        ATTRIBUTE13 = l_def_cle_rec.attribute13,
        ATTRIBUTE14 = l_def_cle_rec.attribute14,
        ATTRIBUTE15 = l_def_cle_rec.attribute15,
        SERVICE_ITEM_YN = l_def_cle_rec.service_item_yn,
                      --new columns for price hold
        ph_pricing_type          = l_def_cle_rec.ph_pricing_type,
        ph_price_break_basis     = l_def_cle_rec.ph_price_break_basis,
        ph_min_qty               = l_def_cle_rec.ph_min_qty,
        ph_min_amt               = l_def_cle_rec.ph_min_amt,
        ph_qp_reference_id       = l_def_cle_rec.ph_qp_reference_id,
        ph_value                 = l_def_cle_rec.ph_value,
        ph_enforce_price_list_yn = l_def_cle_rec.ph_enforce_price_list_yn,
        ph_adjustment            = l_def_cle_rec.ph_adjustment,
        ph_integrated_with_qp    = l_def_cle_rec.ph_integrated_with_qp,
               --new columns to replace rules
        cust_acct_id             = l_def_cle_rec.cust_acct_id,
        bill_to_site_use_id      = l_def_cle_rec.bill_to_site_use_id,
        inv_rule_id              = l_def_cle_rec.inv_rule_id,
        line_renewal_type_code   = l_def_cle_rec.line_renewal_type_code,
        ship_to_site_use_id      = l_def_cle_rec.ship_to_site_use_id,
        payment_term_id          = l_def_cle_rec.payment_term_id,
	--NPALEPU on 03-JUN-2005 Added new column for Annualized Amounts
        annualized_factor        =  l_def_cle_rec.annualized_factor,
        --END NPALEPU
      --LINE LEVEL CANCELLATION--
      date_cancelled            = l_def_cle_rec.date_cancelled,
      --canc_reason_code          = l_def_cle_rec.canc_reason_code,
      term_cancel_source        = l_def_cle_rec.term_cancel_source,
      cancelled_amount		= l_def_cle_rec.cancelled_amount,
      --added by mchoudha 22-JUL
      payment_instruction_type =   l_def_cle_rec.payment_instruction_type
      WHERE ID = l_def_cle_rec.id;
Line: 6810

   okc_debug.log('18600: Exiting update_row', 2);
Line: 6818

       okc_debug.log('18700: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 6834

       okc_debug.log('18800: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 6850

       okc_debug.log('18900: Exiting update_row:OTHERS Exception', 2);
Line: 6864

  END update_row;
Line: 6868

  PROCEDURE update_row(
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_okc_k_lines_tl_rec           IN okc_k_lines_tl_rec_type,
    x_okc_k_lines_tl_rec           OUT NOCOPY okc_k_lines_tl_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 6877

    l_api_name                     CONSTANT VARCHAR2(30) := 'TL_update_row';
Line: 6953

      IF (x_okc_k_lines_tl_rec.last_updated_by = OKC_API.G_MISS_NUM)
      THEN
        x_okc_k_lines_tl_rec.last_updated_by := l_okc_k_lines_tl_rec.last_updated_by;
Line: 6957

      IF (x_okc_k_lines_tl_rec.last_update_date = OKC_API.G_MISS_DATE)
      THEN
        x_okc_k_lines_tl_rec.last_update_date := l_okc_k_lines_tl_rec.last_update_date;
Line: 6961

      IF (x_okc_k_lines_tl_rec.last_update_login = OKC_API.G_MISS_NUM)
      THEN
        x_okc_k_lines_tl_rec.last_update_login := l_okc_k_lines_tl_rec.last_update_login;
Line: 6967

       okc_debug.log('19050: Leaving update_row', 2);
Line: 6995

       okc_debug.log('19200: Entered update_row', 2);
Line: 7023

    UPDATE  OKC_K_LINES_TL
    SET NAME = l_def_okc_k_lines_tl_rec.name,
        COMMENTS = l_def_okc_k_lines_tl_rec.comments,
        ITEM_DESCRIPTION = l_def_okc_k_lines_tl_rec.item_description,
        OKE_BOE_DESCRIPTION = l_def_okc_k_lines_tl_rec.oke_boe_description,
        COGNOMEN            = l_def_okc_k_lines_tl_rec.cognomen,
        BLOCK23TEXT = l_def_okc_k_lines_tl_rec.block23text,
	   SOURCE_LANG = l_def_okc_k_lines_tl_rec.source_lang,
        --CREATED_BY = l_def_okc_k_lines_tl_rec.created_by,          /*Commented for bug 14499300 */
        --CREATION_DATE = l_def_okc_k_lines_tl_rec.creation_date,
        LAST_UPDATED_BY = l_def_okc_k_lines_tl_rec.last_updated_by,
        LAST_UPDATE_DATE = l_def_okc_k_lines_tl_rec.last_update_date,
        LAST_UPDATE_LOGIN = l_def_okc_k_lines_tl_rec.last_update_login
    WHERE ID = l_def_okc_k_lines_tl_rec.id
      AND USERENV('LANG') IN (SOURCE_LANG,LANGUAGE);
Line: 7039

    UPDATE  OKC_K_LINES_TL
    SET SFWT_FLAG = 'Y'
    WHERE ID = l_def_okc_k_lines_tl_rec.id
      AND SOURCE_LANG <> USERENV('LANG');
Line: 7048

       okc_debug.log('19300: Exiting update_row', 2);
Line: 7056

       okc_debug.log('19400: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 7072

       okc_debug.log('19500: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 7088

       okc_debug.log('19600: Exiting update_row:OTHERS Exception', 2);
Line: 7102

  END update_row;
Line: 7106

  PROCEDURE update_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_restricted_update            IN VARCHAR2,
    p_clev_rec                     IN clev_rec_type,
    x_clev_rec                     OUT NOCOPY clev_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 7117

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_update_row';
Line: 7134

      l_clev_rec.LAST_UPDATE_DATE := SYSDATE;
Line: 7135

      l_clev_rec.LAST_UPDATED_BY := FND_GLOBAL.USER_ID;
Line: 7136

      l_clev_rec.LAST_UPDATE_LOGIN := FND_GLOBAL.LOGIN_ID;
Line: 7315

      IF (x_clev_rec.program_update_date  = OKC_API.G_MISS_DATE)
      THEN
        x_clev_rec.program_update_date  := l_clev_rec.program_update_date ;
Line: 7443

      IF (x_clev_rec.last_updated_by = OKC_API.G_MISS_NUM)
      THEN
        x_clev_rec.last_updated_by := l_clev_rec.last_updated_by;
Line: 7447

      IF (x_clev_rec.last_update_date = OKC_API.G_MISS_DATE)
      THEN
        x_clev_rec.last_update_date := l_clev_rec.last_update_date;
Line: 7463

      IF (x_clev_rec.last_update_login = OKC_API.G_MISS_NUM)
      THEN
        x_clev_rec.last_update_login := l_clev_rec.last_update_login;
Line: 7577

       okc_debug.log('20000: Entered update_row', 2);
Line: 7642

    update_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
      l_okc_k_lines_tl_rec,
      lx_okc_k_lines_tl_rec
    );
Line: 7656

    update_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
	 p_restricted_update,
      l_cle_rec,
      lx_cle_rec
    );
Line: 7675

   okc_debug.log('20100: Exiting update_row', 2);
Line: 7683

       okc_debug.log('20200: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 7699

       okc_debug.log('20300: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 7715

       okc_debug.log('20400: Exiting update_row:OTHERS Exception', 2);
Line: 7729

  END update_row;
Line: 7733

  PROCEDURE update_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_restricted_update            IN VARCHAR2,
    p_clev_tbl                     IN clev_tbl_type,
    x_clev_tbl                     OUT NOCOPY clev_tbl_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 7744

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_tbl_update_row';
Line: 7752

       okc_debug.log('20500: Entered update_row', 2);
Line: 7760

        update_row (
          p_api_version                  => p_api_version,
          p_init_msg_list                => OKC_API.G_FALSE,
          x_return_status                => x_return_status,
          x_msg_count                    => x_msg_count,
          x_msg_data                     => x_msg_data,
		p_restricted_update 		 => p_restricted_update,
          p_clev_rec                     => p_clev_tbl(i),
          x_clev_rec                     => x_clev_tbl(i));
Line: 7785

    okc_debug.log('20600: Exiting update_row', 2);
Line: 7793

       okc_debug.log('20700: Exiting update_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 7809

       okc_debug.log('20800: Exiting update_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 7825

       okc_debug.log('20900: Exiting update_row:OTHERS Exception', 2);
Line: 7839

  END update_row;
Line: 7847

  PROCEDURE delete_row(
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_cle_rec                      IN cle_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 7855

    l_api_name                     CONSTANT VARCHAR2(30) := 'B_delete_row';
Line: 7863

       okc_debug.log('21000: Entered delete_row', 2);
Line: 7875

    DELETE FROM OKC_K_LINES_B
     WHERE ID = l_cle_rec.id;
Line: 7881

    okc_debug.log('21100: Leaving delete_row', 2);
Line: 7889

       okc_debug.log('21200: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 7905

       okc_debug.log('21300: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 7921

       okc_debug.log('21400: Exiting delete_row:OTHERS Exception', 2);
Line: 7935

  END delete_row;
Line: 7939

  PROCEDURE delete_row(
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_okc_k_lines_tl_rec           IN okc_k_lines_tl_rec_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 7947

    l_api_name                     CONSTANT VARCHAR2(30) := 'TL_delete_row';
Line: 7970

       okc_debug.log('21600: Entered delete_row', 2);
Line: 7992

    DELETE FROM OKC_K_LINES_TL
     WHERE ID = l_okc_k_lines_tl_rec.id;
Line: 7998

    okc_debug.log('21700: Exiting delete_row', 2);
Line: 8006

       okc_debug.log('21800: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 8022

       okc_debug.log('21900: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 8038

       okc_debug.log('22000: Exiting delete_row:OTHERS Exception', 2);
Line: 8052

  END delete_row;
Line: 8056

  PROCEDURE delete_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_clev_rec                     IN clev_rec_type) IS

    l_api_version                  CONSTANT NUMBER := 1;
Line: 8065

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_delete_row';
Line: 8086

          SELECT id, object_version_number,oie_id,object_chr_id,active_yn,object_cle_id
          FROM okc_operation_lines
          WHERE subject_cle_id = p_clev_rec.id;
Line: 8091

          SELECT cle_id
          FROM okc_k_lines_b
          WHERE id = p_line_id
            AND lse_id in (7,8,9,10,11,13,18,25,35);
Line: 8097

          SELECT opn_code
          FROM okc_class_operations
          WHERE id = (SELECT cop_id
		            FROM okc_operation_instances
				  WHERE id = p_oie_id );
Line: 8109

           SELECT ste_code
           FROM okc_statuses_b
           WHERE code = (SELECT sts_code
		               FROM okc_k_lines_b
					WHERE id = p_clev_rec.id);
Line: 8119

       okc_debug.log('22100: Entered delete_row', 2);
Line: 8130

	                        p_msg_name      => 'OKC_CANNOT_DELETE_LINE');
Line: 8161

    delete_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
      l_okc_k_lines_tl_rec
    );
Line: 8173

    delete_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
      l_cle_rec
    );
Line: 8195

	    -- When a line is deleted, if the line is renewed from a contract
	    -- that contract cannot be considered as renewed
	    -- so, set the date_renewed of that source contract to null
	    --
	    If (ole_rec.active_yn = 'Y') Then
                    --npalepu 08-11-2005 modified for bug # 4691662.
                    --Replaced table okc_k_headers_b with headers_All_b table
                    /* UPDATE okc_k_headers_b */
                    UPDATE OKC_K_HEADERS_ALL_B
                    --end npalepu
		    SET    date_renewed = null
		    WHERE id = ole_rec.object_chr_id
		    AND date_renewed is not null;
Line: 8219

		 OKC_OPER_INST_PUB.Delete_Operation_Line (
		    p_api_version		=> p_api_version,
		    p_init_msg_list	     => p_init_msg_list,
		    x_return_status 	=> x_return_status,
		    x_msg_count     	=> x_msg_count,
		    x_msg_data      	=> x_msg_data,
		    p_olev_rec		     => l_olev_rec);
Line: 8234

 		 UPDATE okc_k_lines_b
		 SET    date_renewed = null
		 WHERE id = ole_rec.object_cle_id
		 AND date_renewed is not null;
Line: 8245

   		     UPDATE okc_k_lines_b
		     SET    date_renewed = null
		     WHERE id  = l_parent_line_id
		     AND date_renewed is not null;
Line: 8257

		 OKC_OPER_INST_PUB.Update_Operation_Line (
		    p_api_version		=> p_api_version,
		    p_init_msg_list	     => p_init_msg_list,
		    x_return_status 	=> x_return_status,
		    x_msg_count     	=> x_msg_count,
		    x_msg_data      	=> x_msg_data,
		    p_olev_rec		     => l_olev_rec,
		    x_olev_rec           => x_olev_rec);
Line: 8277

   okc_debug.log('22200: Exiting delete_row', 2);
Line: 8285

       okc_debug.log('22300: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 8301

       okc_debug.log('22400: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 8317

       okc_debug.log('22500: Exiting delete_row:OTHERS Exception', 2);
Line: 8331

  END delete_row;
Line: 8335

  PROCEDURE delete_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_clev_tbl                     IN clev_tbl_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 8344

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
Line: 8352

       okc_debug.log('22600: Entered delete_row', 2);
Line: 8360

        delete_row (
          p_api_version                  => p_api_version,
          p_init_msg_list                => OKC_API.G_FALSE,
          x_return_status                => x_return_status,
          x_msg_count                    => x_msg_count,
          x_msg_data                     => x_msg_data,
          p_clev_rec                     => p_clev_tbl(i));
Line: 8383

    okc_debug.log('22700: Exiting delete_row', 2);
Line: 8391

       okc_debug.log('22800: Exiting delete_row:OKC_API.G_EXCEPTION_ERROR Exception', 2);
Line: 8407

       okc_debug.log('22900: Exiting delete_row:OKC_API.G_EXCEPTION_UNEXPECTED_ERROR Exception', 2);
Line: 8423

       okc_debug.log('23000: Exiting delete_row:OTHERS Exception', 2);
Line: 8437

  END delete_row;
Line: 8442

PROCEDURE force_delete_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_clev_rec                     IN clev_rec_type) IS

    l_api_version                  CONSTANT NUMBER := 1;
Line: 8451

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_delete_row';
Line: 8469

          SELECT id, object_version_number,oie_id,object_chr_id,active_yn
          FROM okc_operation_lines
          WHERE subject_cle_id = p_clev_rec.id;
Line: 8474

          SELECT opn_code
          FROM okc_class_operations
          WHERE id = (SELECT cop_id
		            FROM okc_operation_instances
				  WHERE id = p_oie_id );
Line: 8491

    delete_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
      l_okc_k_lines_tl_rec
    );
Line: 8503

    delete_row(
      p_init_msg_list,
      x_return_status,
      x_msg_count,
      x_msg_data,
      l_cle_rec
    );
Line: 8525

	    -- When a line is deleted, if the line is renewed from a contract
	    -- that contract cannot be considered as renewed
	    -- so, set the date_renewed of that source contract to null
	    --
	    If (ole_rec.active_yn = 'Y') Then
                    --npalepu 08-11-2005 modified for bug # 4691662.
                    --Replaced table okc_k_headers_b with headers_All_b table
                    /* UPDATE okc_k_headers_b */
                    UPDATE OKC_K_HEADERS_ALL_B
                    --end npalepu
		    SET    date_renewed = null
		    WHERE id = ole_rec.object_chr_id
		    AND date_renewed is not null;
Line: 8549

		 OKC_OPER_INST_PUB.Delete_Operation_Line (
		    p_api_version		=> p_api_version,
		    p_init_msg_list	     => p_init_msg_list,
		    x_return_status 	=> x_return_status,
		    x_msg_count     	=> x_msg_count,
		    x_msg_data      	=> x_msg_data,
		    p_olev_rec		     => l_olev_rec);
Line: 8563

		 OKC_OPER_INST_PUB.Update_Operation_Line (
		    p_api_version		=> p_api_version,
		    p_init_msg_list	     => p_init_msg_list,
		    x_return_status 	=> x_return_status,
		    x_msg_count     	=> x_msg_count,
		    x_msg_data      	=> x_msg_data,
		    p_olev_rec		     => l_olev_rec,
		    x_olev_rec           => x_olev_rec);
Line: 8611

END force_delete_row;
Line: 8616

PROCEDURE force_delete_row(
    p_api_version                  IN NUMBER,
    p_init_msg_list                IN VARCHAR2,
    x_return_status                OUT NOCOPY VARCHAR2,
    x_msg_count                    OUT NOCOPY NUMBER,
    x_msg_data                     OUT NOCOPY VARCHAR2,
    p_clev_tbl                     IN clev_tbl_type) IS

    l_api_version                 CONSTANT NUMBER := 1;
Line: 8625

    l_api_name                     CONSTANT VARCHAR2(30) := 'V_tbl_delete_row';
Line: 8635

        force_delete_row (
          p_api_version                  => p_api_version,
          p_init_msg_list                => OKC_API.G_FALSE,
          x_return_status                => x_return_status,
          x_msg_count                    => x_msg_count,
          x_msg_data                     => x_msg_data,
          p_clev_rec                     => p_clev_tbl(i));
Line: 8687

END force_delete_row;
Line: 8692

PROCEDURE INSERT_ROW_UPG(x_return_status OUT NOCOPY VARCHAR2, p_clev_tbl clev_tbl_type) IS
  l_tabsize NUMBER := p_clev_tbl.COUNT;
Line: 8735

  in_program_update_date           OKC_DATATYPES.DateTabTyp;
Line: 8769

  in_last_updated_by               OKC_DATATYPES.NumberTabTyp;
Line: 8770

  in_last_update_date              OKC_DATATYPES.DateTabTyp;
Line: 8771

  in_last_update_login             OKC_DATATYPES.NumberTabTyp;
Line: 8813

       okc_debug.log('23100: Entered INSERT_ROW_UPG', 2);
Line: 8874

    in_program_update_date 	(j) := p_clev_tbl(i).program_update_date;
Line: 8908

    in_last_updated_by          (j) := p_clev_tbl(i).last_updated_by;
Line: 8909

    in_last_update_date         (j) := p_clev_tbl(i).last_update_date;
Line: 8910

    in_last_update_login        (j) := p_clev_tbl(i).last_update_login;
Line: 8946

    INSERT
      INTO OKC_K_LINES_B
      (
        id,
        line_number,
        chr_id,
        cle_id,
        dnz_chr_id,
        display_sequence,
        sts_code,
        trn_code,
        lse_id,
        exception_yn,
        object_version_number,
        created_by,
        creation_date,
        last_updated_by,
        last_update_date,
        hidden_ind,
        price_negotiated,
        price_level_ind,
        price_unit,
        price_unit_percent,
        invoice_line_level_ind,
        dpas_rating,
        template_used,
        price_type,
        currency_code,
        last_update_login,
        date_terminated,
        start_date,
        end_date,
        date_renewed,
        upg_orig_system_ref,
        upg_orig_system_ref_id,
        orig_system_source_code,
        orig_system_id1,
        orig_system_reference1,
        request_id,
        program_application_id,
        program_id,
        program_update_date,
        price_list_id,
        pricing_date,
        price_list_line_id,
        line_list_price,
        item_to_price_yn,
        price_basis_yn,
        config_header_id,
        config_revision_number,
        config_complete_yn,
        config_valid_yn,
        config_top_model_line_id,
        config_item_type,
---Bug.No.-1942374
        config_item_id,
---Bug.No.-1942374
        attribute_category,
        attribute1,
        attribute2,
        attribute3,
        attribute4,
        attribute5,
        attribute6,
        attribute7,
        attribute8,
        attribute9,
        attribute10,
        attribute11,
        attribute12,
        attribute13,
        attribute14,
        attribute15,
        currency_code_renewed,
        price_negotiated_renewed,
        service_item_yn,
                      --new columns for price hold
        ph_pricing_type,
        ph_price_break_basis,
        ph_min_qty,
        ph_min_amt,
        ph_qp_reference_id,
        ph_value,
        ph_enforce_price_list_yn,
        ph_adjustment,
        ph_integrated_with_qp,
-- new columns to replace rules
        cust_acct_id,
        bill_to_site_use_id,
        inv_rule_id,
        line_renewal_type_code,
        ship_to_site_use_id,
        payment_term_id,
        payment_instruction_type,   --added by mchoudha 22-JUL
/*** R12 data model Changes 27072005 to be checked Start***/
       annualized_factor             ,
    -- Line level Cancellation --
       date_cancelled		  ,
       --canc_reason_code		  ,
       term_cancel_source		,
       cancelled_amount
/*** R12 data model Changes 27072005 to be checked End***/
     )
     VALUES (
        in_id(i),
        in_line_number(i),
        in_chr_id(i),
        in_cle_id(i),
        in_dnz_chr_id(i),
        in_display_sequence(i),
        in_sts_code(i),
        in_trn_code(i),
        in_lse_id(i),
        in_exception_yn(i),
        in_object_version_number(i),
        in_created_by(i),
        in_creation_date(i),
        in_last_updated_by(i),
        in_last_update_date(i),
        in_hidden_ind(i),
        in_price_negotiated(i),
        in_price_level_ind(i),
        in_price_unit(i),
        in_price_unit_percent(i),
        in_invoice_line_level_ind(i),
        in_dpas_rating(i),
        in_template_used(i),
        in_price_type(i),
        in_currency_code(i),
        in_last_update_login(i),
        in_date_terminated(i),
        in_start_date(i),
        in_end_date(i),
        in_date_renewed(i),
        in_upg_orig_system_ref(i),
        in_upg_orig_system_ref_id(i),
        in_orig_system_source_code(i),
        in_orig_system_id1(i),
        in_orig_system_reference1(i),
        in_request_id(i),
        in_program_application_id(i),
        in_program_id(i),
        in_program_update_date(i),
        in_price_list_id(i),
        in_pricing_date(i),
        in_price_list_line_id(i),
        in_line_list_price(i),
        in_item_to_price_yn(i),
        in_price_basis_yn(i),
        in_config_header_id(i),
        in_config_revision_number(i),
        in_config_complete_yn(i),
        in_config_valid_yn(i),
        in_config_top_model_line_id(i),
        in_config_item_type(i),
---Bug.No.-1942374
        in_config_item_id(i),
---Bug.No.-1942374
        in_attribute_category(i),
        in_attribute1(i),
        in_attribute2(i),
        in_attribute3(i),
        in_attribute4(i),
        in_attribute5(i),
        in_attribute6(i),
        in_attribute7(i),
        in_attribute8(i),
        in_attribute9(i),
        in_attribute10(i),
        in_attribute11(i),
        in_attribute12(i),
        in_attribute13(i),
        in_attribute14(i),
        in_attribute15(i),
        in_currency_code_renewed(i),
        in_price_negotiated_renewed(i),
        in_service_item_yn(i),
--new columns for price hold

        in_ph_pricing_type(i),
        in_ph_price_break_basis(i),
        in_ph_min_qty(i),
        in_ph_min_amt(i),
        in_ph_qp_reference_id(i),
        in_ph_value(i),
        in_ph_enforce_price_list_yn(i),
        in_ph_adjustment(i),
        in_ph_integrated_with_qp(i),

 --new columns to replace rules
        in_cust_acct_id(i),
        in_bill_to_site_use_id(i),
        in_inv_rule_id(i),
        in_line_renewal_type_code (i),
        in_ship_to_site_use_id(i),
        in_payment_term_id(i)  ,
        in_payment_instruction_type(i) ,  --added by mchoudha 22-JUL
/*** R12 data model Changes 27072005 to be checked Start***/
        in_annualized_factor(i)             ,
        -- Line level Cancellation --
        in_date_cancelled(i)		  ,
        --in_canc_reason_code(i)		  ,
        in_term_cancel_source(i)		,
	in_cancelled_amount(i)
/*** R12 data model Changes 27072005 to be checked End***/
     );
Line: 9155

      INSERT INTO OKC_K_LINES_TL(
        id,
        language,
        source_lang,
        sfwt_flag,
        name,
        comments,
        item_description,
	oke_boe_description,
	cognomen,
        block23text,
        created_by,
        creation_date,
        last_updated_by,
        last_update_date,
        last_update_login
     )
     VALUES (
        in_id(i),
        OKC_UTIL.g_language_code(lang_i),
        l_source_lang,
        in_sfwt_flag(i),
        in_name(i),
        in_comments(i),
        in_item_description(i),
        in_oke_boe_description(i),
        in_cognomen(i),
        in_block23text(i),
        in_created_by(i),
        in_creation_date(i),
        in_last_updated_by(i),
        in_last_update_date(i),
        in_last_update_login(i)
      );
Line: 9192

   okc_debug.log('23200: Leaving INSERT_ROW_UPG', 2);
Line: 9200

       okc_debug.log('23300: Exiting INSERT_ROW_UPG:OTHERS Exception', 2);
Line: 9216

END INSERT_ROW_UPG;
Line: 9236

INSERT INTO okc_k_lines_bh
  (
      major_version,
      id,
      line_number,
      chr_id,
      cle_id,
      dnz_chr_id,
      display_sequence,
      sts_code,
      trn_code,
      lse_id,
      exception_yn,
      object_version_number,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      hidden_ind,
      price_negotiated,
      price_level_ind,
      price_unit,
      price_unit_percent,
      invoice_line_level_ind,
      dpas_rating,
      template_used,
      price_type,
      --uom_code,
      currency_code,
      last_update_login,
      date_terminated,
      start_date,
      end_date,
      date_renewed,
      orig_system_source_code,
      orig_system_id1,
      orig_system_reference1,
      upg_orig_system_ref,
      upg_orig_system_ref_id,
      request_id,
      program_application_id,
      program_id,
      program_update_date,
      price_list_id,
      pricing_date,
      price_list_line_id,
      line_list_price,
      item_to_price_yn,
      price_basis_yn,
      config_header_id,
      config_revision_number,
      config_complete_yn,
      config_valid_yn,
      config_top_model_line_id,
      config_item_type,
---Bug.No.-1942374
      config_item_id,
---Bug.No.-1942374
      attribute_category,
      attribute1,
      attribute2,
      attribute3,
      attribute4,
      attribute5,
      attribute6,
      attribute7,
      attribute8,
      attribute9,
      attribute10,
      attribute11,
      attribute12,
      attribute13,
      attribute14,
      attribute15,
      currency_code_renewed,
      price_negotiated_renewed,
      service_item_yn,
                      --new columns for price hold
      ph_pricing_type,
      ph_price_break_basis,
      ph_min_qty,
      ph_min_amt,
      ph_qp_reference_id,
      ph_value,
      ph_enforce_price_list_yn,
      ph_adjustment,
      ph_integrated_with_qp,
 -- new columns to replace rules
      cust_acct_id,
      bill_to_site_use_id,
      inv_rule_id,
      line_renewal_type_code,
      ship_to_site_use_id,
      payment_term_id,
      date_cancelled, -- added as part of LLC
      --canc_reason_code,
      term_cancel_source,
      cancelled_amount,
      payment_instruction_type, --added by mchoudha 22-JUL
      annualized_factor    --Added by npalepu 26-JUL
)
  SELECT
      p_major_version,
      id,
      line_number,
      chr_id,
      cle_id,
      dnz_chr_id,
      display_sequence,
      sts_code,
      trn_code,
      lse_id,
      exception_yn,
      object_version_number,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      hidden_ind,
      price_negotiated,
      price_level_ind,
      price_unit,
      price_unit_percent,
      invoice_line_level_ind,
      dpas_rating,
      template_used,
      price_type,
      --uom_code,
      currency_code,
      last_update_login,
      date_terminated,
      start_date,
      end_date,
      date_renewed,
      orig_system_source_code,
      orig_system_id1,
      orig_system_reference1,
      upg_orig_system_ref,
      upg_orig_system_ref_id,
      request_id,
      program_application_id,
      program_id,
      program_update_date,
      price_list_id,
      pricing_date,
      price_list_line_id,
      line_list_price,
      item_to_price_yn,
      price_basis_yn,
      config_header_id,
      config_revision_number,
      config_complete_yn,
      config_valid_yn,
      config_top_model_line_id,
      config_item_type,
---Bug.No.-1942374
      config_item_id,
---Bug.No.-1942374
      attribute_category,
      attribute1,
      attribute2,
      attribute3,
      attribute4,
      attribute5,
      attribute6,
      attribute7,
      attribute8,
      attribute9,
      attribute10,
      attribute11,
      attribute12,
      attribute13,
      attribute14,
      attribute15,
      currency_code_renewed,
      price_negotiated_renewed,
      service_item_yn,
                      --new columns for price hold
      ph_pricing_type,
      ph_price_break_basis,
      ph_min_qty,
      ph_min_amt,
      ph_qp_reference_id,
      ph_value,
      ph_enforce_price_list_yn,
      ph_adjustment,
      ph_integrated_with_qp,
--new columns to replace rules
      cust_acct_id,
      bill_to_site_use_id,
      inv_rule_id,
      line_renewal_type_code,
      ship_to_site_use_id,
      payment_term_id,
      date_cancelled,  -- Added as part of LLC
      --canc_reason_code,
      term_cancel_source,
      cancelled_amount,
      payment_instruction_type, --Added by mchoudha 22-JUL
      annualized_factor   --Added by npalepu 26-JUL
  FROM okc_k_lines_b
 WHERE dnz_chr_id = p_chr_id;
Line: 9443

INSERT INTO okc_k_lines_tlh
  (
      major_version,
      id,
      language,
      source_lang,
      sfwt_flag,
      name,
      comments,
      item_description,
      oke_boe_description,
      cognomen,
      block23text,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      last_update_login
)
  SELECT
      p_major_version,
      id,
      language,
      source_lang,
      sfwt_flag,
      name,
      comments,
      item_description,
      oke_boe_description,
      cognomen,
      block23text,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      last_update_login
  FROM okc_k_lines_tl
WHERE id in (select id
		   from okc_k_lines_b
		   where dnz_chr_id = p_chr_id);
Line: 9532

INSERT INTO okc_k_lines_tl
  (
      id,
      language,
      source_lang,
      sfwt_flag,
      name,
      comments,
      item_description,
      oke_boe_description,
      cognomen,
      block23text,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      last_update_login
)
  SELECT
      id,
      language,
      source_lang,
      sfwt_flag,
      name,
      comments,
      item_description,
      oke_boe_description,
      cognomen,
      block23text,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      last_update_login
  FROM okc_k_lines_tlh
 WHERE id in (SELECT id
			 FROM okc_k_lines_bh
			WHERE dnz_chr_id = p_chr_id)
  AND major_version = p_major_version;
Line: 9576

INSERT INTO okc_k_lines_b
  (
      id,
      line_number,
      chr_id,
      cle_id,
      dnz_chr_id,
      display_sequence,
      sts_code,
      trn_code,
      lse_id,
      exception_yn,
      object_version_number,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      hidden_ind,
      price_negotiated,
      price_level_ind,
      price_unit,
      price_unit_percent,
      invoice_line_level_ind,
      dpas_rating,
      template_used,
      price_type,
      --uom_code,
      currency_code,
      last_update_login,
      date_terminated,
      start_date,
      end_date,
      date_renewed,
      orig_system_source_code,
      orig_system_id1,
      orig_system_reference1,
      upg_orig_system_ref,
      upg_orig_system_ref_id,
      request_id,
      program_application_id,
      program_id,
      program_update_date,
      price_list_id,
      pricing_date,
      price_list_line_id,
      line_list_price,
      item_to_price_yn,
      price_basis_yn,
      config_header_id,
      config_revision_number,
      config_complete_yn,
      config_valid_yn,
      config_top_model_line_id,
      config_item_type,
---Bug.No.-1942374
      config_item_id,
---Bug.No.-1942374
      attribute_category,
      attribute1,
      attribute2,
      attribute3,
      attribute4,
      attribute5,
      attribute6,
      attribute7,
      attribute8,
      attribute9,
      attribute10,
      attribute11,
      attribute12,
      attribute13,
      attribute14,
      attribute15,
      currency_code_renewed,
      price_negotiated_renewed,
      service_item_yn,
                      --new columns for price hold
      ph_pricing_type,
      ph_price_break_basis,
      ph_min_qty,
      ph_min_amt,
      ph_qp_reference_id,
      ph_value,
      ph_enforce_price_list_yn,
      ph_adjustment,
      ph_integrated_with_qp,
--new columns to replace rules
      cust_acct_id,
      bill_to_site_use_id,
      inv_rule_id,
      line_renewal_type_code,
      ship_to_site_use_id,
      payment_term_id,
      payment_instruction_type, --added by mchoudha 22-JUL
      DATE_CANCELLED,  --added by npalepu 26-JUL -- New columns for Line Level Cancellation
      --canc_reason_code,
      TERM_CANCEL_SOURCE,
      cancelled_amount,
      annualized_factor   --added by npalepu 26-JUL
)
  SELECT
      id,
      line_number,
      chr_id,
      cle_id,
      dnz_chr_id,
      display_sequence,
      sts_code,
      trn_code,
      lse_id,
      exception_yn,
      object_version_number,
      created_by,
      creation_date,
      last_updated_by,
      last_update_date,
      hidden_ind,
      price_negotiated,
      price_level_ind,
      price_unit,
      price_unit_percent,
      invoice_line_level_ind,
      dpas_rating,
      template_used,
      price_type,
      --uom_code,
      currency_code,
      last_update_login,
      date_terminated,
      start_date,
      end_date,
      date_renewed,
      orig_system_source_code,
      orig_system_id1,
      orig_system_reference1,
      upg_orig_system_ref,
      upg_orig_system_ref_id,
      request_id,
      program_application_id,
      program_id,
      program_update_date,
      price_list_id,
      pricing_date,
      price_list_line_id,
      line_list_price,
      item_to_price_yn,
      price_basis_yn,
      config_header_id,
      config_revision_number,
      config_complete_yn,
      config_valid_yn,
      config_top_model_line_id,
      config_item_type,
---Bug.No.-1942374
      config_item_id,
---Bug.No.-1942374
      attribute_category,
      attribute1,
      attribute2,
      attribute3,
      attribute4,
      attribute5,
      attribute6,
      attribute7,
      attribute8,
      attribute9,
      attribute10,
      attribute11,
      attribute12,
      attribute13,
      attribute14,
      attribute15,
      currency_code_renewed,
      price_negotiated_renewed,
      service_item_yn,
                      --new columns for price hold
      ph_pricing_type,
      ph_price_break_basis,
      ph_min_qty,
      ph_min_amt,
      ph_qp_reference_id,
      ph_value,
      ph_enforce_price_list_yn,
      ph_adjustment,
      ph_integrated_with_qp,
-- new columns to replace rules
      cust_acct_id,
      bill_to_site_use_id,
      inv_rule_id,
      line_renewal_type_code,
      ship_to_site_use_id,
      payment_term_id,
      payment_instruction_type, --added by mchoudha 22-JUL
      DATE_CANCELLED,  --added by npalepu 26-JUL -- New columns for Line Level Cancellation
      --canc_reason_code,
      TERM_CANCEL_SOURCE,
      cancelled_amount,
      annualized_factor   --added by npalepu 26-JUL

  FROM okc_k_lines_bh
WHERE dnz_chr_id = p_chr_id
  AND major_version = p_major_version;