DBA Data[Home] [Help]

APPS.OE_CREDIT_CHECK_RPT SQL Statements

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

Line: 26

PROCEDURE Insert_In_Temp_Table
  ( p_header_id		IN NUMBER
   ,p_credit_status     IN VARCHAR2
  )
IS
  l_party_name VARCHAR2(50);
Line: 39

  OE_DEBUG_PUB.ADD('IN  OEXRCRCB: Insert_In_Temp_Table');
Line: 49

    SELECT SUBSTRB(HP.PARTY_NAME,1,50) NAME,
           HCA.ACCOUNT_NUMBER
    INTO   l_party_name,
           l_account_number
    FROM   HZ_CUST_ACCOUNTS HCA,
           HZ_PARTIES HP
    WHERE  HCA.PARTY_ID = HP.PARTY_ID
    AND    HCA.CUST_ACCOUNT_ID = l_header_rec.sold_to_org_id;
Line: 64

    SELECT otv.name
    INTO   l_transaction_type_name
    FROM   oe_transaction_types_vl otv
    WHERE  l_header_rec.order_type_id = otv.transaction_type_id;
Line: 83

    SELECT meaning
    INTO   l_credit_status
    FROM   oe_lookups
    WHERE  lookup_code = p_credit_status
    AND    lookup_type = 'CREDIT_CHECK_STATUS';
Line: 94

  INSERT INTO OE_CC_PROCESSOR_TEMP (
    PARTY_NAME
   ,ACCOUNT_NUMBER
   ,TRANSACTION_TYPE_NAME
   ,ORDER_NUMBER
   ,CREDIT_STATUS
   ,CREDIT_STATUS_SORT
  )
  VALUES (
    l_party_name
   ,l_account_number
   ,l_transaction_type_name
   ,l_header_rec.order_number
   ,l_credit_status
   ,l_credit_status_sort
  );
Line: 110

  OE_DEBUG_PUB.ADD('Inserted row into temporary table ');
Line: 111

  OE_DEBUG_PUB.ADD('OUT OEXRCRCB: Insert_In_Temp_Table');
Line: 114

    OE_DEBUG_PUB.ADD('OEXRCRCB: Insert_In_Temp_Table - Unexpected Error');
Line: 116

END Insert_In_Temp_Table;
Line: 166

  v_hold_final_select    VARCHAR2(7000) := NULL;
Line: 169

  v_release_final_select VARCHAR2(7000) := NULL;
Line: 197

    SELECT ou.organization_id
      FROM hr_operating_units ou
     WHERE mo_global.check_access(ou.organization_id) = 'Y';
Line: 228

    OE_DEBUG_PUB.ADD('Building the SELECT statement',2);
Line: 258

                                         (SELECT HCP.cust_account_id
                                          FROM   HZ_CUSTOMER_PROFILES HCP,
                                                 HZ_CUST_PROFILE_CLASSES HCPC
                                          WHERE  HCP.profile_class_id = HCPC.profile_class_id
                                          AND    HCP.cust_account_id = OH.sold_to_org_id
										  AND    HCP.STATUS=''A''
                                          AND    HCPC.name = :cust_prof_class_from) ';
Line: 268

                                         (SELECT HCP.cust_account_id
                                          FROM   HZ_CUSTOMER_PROFILES HCP,
                                                 HZ_CUST_PROFILE_CLASSES HCPC
                                          WHERE  HCP.profile_class_id = HCPC.profile_class_id
                                          AND    HCP.cust_account_id = OH.sold_to_org_id
										  AND    HCP.STATUS=''A''
                                          AND    HCPC.name >= :cust_prof_class_from) ';
Line: 278

                                         (SELECT HCP.cust_account_id
                                          FROM   HZ_CUSTOMER_PROFILES HCP,
                                                 HZ_CUST_PROFILE_CLASSES HCPC
                                          WHERE  HCP.profile_class_id = HCPC.profile_class_id
                                          AND    HCP.cust_account_id = OH.sold_to_org_id
										  AND    HCP.STATUS=''A''
                                          AND    HCPC.name <= :cust_prof_class_to) ';
Line: 288

                                         (SELECT HCP.cust_account_id
                                          FROM   HZ_CUSTOMER_PROFILES HCP,
                                                 HZ_CUST_PROFILE_CLASSES HCPC
                                          WHERE  HCP.profile_class_id = HCPC.profile_class_id
                                          AND    HCP.cust_account_id = OH.sold_to_org_id
										  AND    HCP.STATUS=''A''
                                          AND    HCPC.name BETWEEN :cust_prof_class_from AND
                                                 :cust_prof_class_to) ';
Line: 306

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA,
                                        HZ_PARTIES HP
                                 WHERE  HCA.party_id = HP.party_id
                                 AND    HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HP.party_name = :party_name_from
                                 ) ';
Line: 316

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA,
                                        HZ_PARTIES HP
                                 WHERE  HCA.party_id = HP.party_id
                                 AND    HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HP.party_name >= :party_name_from
                                 ) ';
Line: 326

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA,
                                        HZ_PARTIES HP
                                 WHERE  HCA.party_id = HP.party_id
                                 AND    HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HP.party_name <= :party_name_to
                                 ) ';
Line: 336

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA,
                                        HZ_PARTIES HP
                                 WHERE  HCA.party_id = HP.party_id
                                 AND    HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HP.party_name BETWEEN :party_name_from AND :party_name_to
                                 ) ';
Line: 352

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA
                                 WHERE  HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HCA.account_number = :cust_acct_number_from
                                 ) ';
Line: 360

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA
                                 WHERE  HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HCA.account_number >= :cust_acct_number_from
                                 ) ';
Line: 368

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA
                                 WHERE  HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HCA.account_number <= :cust_acct_number_to
                                 ) ';
Line: 376

                                 SELECT HCA.cust_account_id
                                 FROM   HZ_CUST_ACCOUNTS HCA
                                 WHERE  HCA.cust_account_id = OH.sold_to_org_id
                                 AND    HCA.account_number BETWEEN :cust_acct_number_from AND :cust_acct_number_to
                                 ) ';
Line: 409

      v_hold_final_select :=  'SELECT OH.header_id
                          FROM   OE_ORDER_HEADERS_ALL OH, OE_ORDER_LINES_ALL OL
                          WHERE  OH.BOOKED_FLAG = ''Y''
                          AND    OH.OPEN_FLAG = ''Y''
                          AND    OH.order_category_code <> ''RETURN''
                          AND    NVL(OH.org_id,-99) = :profile_org_id
                          AND    OH.header_id = OL.header_id
                          AND    OL.flow_status_code = ''BOOKED''
                          AND    OL.open_flag = ''Y''
                          AND    OL.booked_flag = ''Y''
                          AND    OL.line_category_code = ''ORDER''
                          AND    NVL(OL.invoiced_quantity, 0) = 0
                          AND    NVL(OL.shipped_quantity, 0) = 0 '
                        ||v_cust_prof_class_clause
                        ||v_party_name_clause
                        ||v_cust_acct_number_clause
                        ||v_order_date_clause
                        ||v_order_by_clause;
Line: 428

      v_release_final_select :=  'SELECT OH.header_id
                          FROM   OE_ORDER_HEADERS_ALL OH, OE_ORDER_LINES_ALL OL,
                                 OE_HOLD_SOURCES_ALL OHS
                          WHERE  OH.BOOKED_FLAG = ''Y''
                          AND    OH.OPEN_FLAG = ''Y''
                          AND    OH.order_category_code <> ''RETURN''
                          AND    NVL(OH.org_id,-99) = :profile_org_id
                          AND    OH.header_id = OL.header_id
                          AND    OL.open_flag = ''Y''
                          AND    OL.booked_flag = ''Y''
                          AND    OL.line_category_code = ''ORDER''
                          AND    NVL(OL.invoiced_quantity, 0) = 0
                          AND    NVL(OL.shipped_quantity, 0) = 0
                          AND    OH.header_id = OHS.hold_entity_id
                          AND    OHS.hold_entity_code = ''O''
                          AND    OHS.released_flag = ''N''
                          AND    OHS.hold_id = 1
                          AND    NVL(OHS.hold_until_date, SYSDATE+1) > SYSDATE '
                        ||v_cust_prof_class_clause
                        ||v_party_name_clause
                        ||v_cust_acct_number_clause
                        ||v_order_date_clause
                        ||v_order_by_clause;
Line: 453

      v_hold_final_select :=  'SELECT OH.header_id
                          FROM   OE_ORDER_HEADERS_ALL OH
                          WHERE  OH.BOOKED_FLAG = ''Y''
                          AND    OH.OPEN_FLAG = ''Y''
                          AND    OH.order_category_code <> ''RETURN''
                          AND    NVL(OH.org_id,-99) = :profile_org_id
                          AND    EXISTS (SELECT 1
                                         FROM   OE_ORDER_LINES_ALL OL
                                         WHERE  NVL(OL.org_id,-99) = :profile_org_id
                                         AND    OL.header_id = OH.header_id
                                         AND    OL.line_category_code = ''ORDER''
                                         AND    OL.open_flag = ''Y''
                                         AND    OL.booked_flag = ''Y''
                                         AND    OL.flow_status_code = ''BOOKED''
                                         AND    NVL(OL.invoiced_quantity, 0) = 0
                                         AND    NVL(OL.shipped_quantity, 0) = 0) '
                        ||v_cust_prof_class_clause
                        ||v_party_name_clause
                        ||v_cust_acct_number_clause
                        ||v_order_date_clause
                        ||v_order_by_clause;
Line: 475

      v_release_final_select :=  'SELECT OH.header_id
                          FROM   OE_ORDER_HEADERS_ALL OH
                          WHERE  OH.BOOKED_FLAG = ''Y''
                          AND    OH.OPEN_FLAG = ''Y''
                          AND    OH.order_category_code <> ''RETURN''
                          AND    NVL(OH.org_id,-99) = :profile_org_id
                          AND    EXISTS (SELECT 1
                                         FROM   OE_HOLD_SOURCES_ALL OHS
                                         WHERE  OHS.hold_entity_code = ''O''
                                         AND    OHS.hold_id = 1
                                         AND    OHS.released_flag = ''N''
                                         AND    NVL(OHS.hold_until_date, SYSDATE+1) > SYSDATE
                                         AND    OHS.hold_entity_id = OH.header_id
                                         )
                          AND    EXISTS (SELECT 1
                                         FROM   OE_ORDER_LINES_ALL OL
                                         WHERE  NVL(OL.org_id,-99) = :profile_org_id
                                         AND    OL.header_id = OH.header_id
                                         AND    OL.open_flag = ''Y''
                                         AND    OL.booked_flag = ''Y''
                                         AND    OL.line_category_code = ''ORDER''
                                         AND    NVL(OL.invoiced_quantity, 0) = 0
                                         AND    NVL(OL.shipped_quantity, 0) = 0 ) '
                        ||v_cust_prof_class_clause
                        ||v_party_name_clause
                        ||v_cust_acct_number_clause
                        ||v_order_date_clause
                        ||v_order_by_clause;
Line: 505

    OE_DEBUG_PUB.ADD('Hold select    : '||v_hold_final_select,2);  --bug# 5187621
Line: 506

    OE_DEBUG_PUB.ADD('Release select : '||v_release_final_select,2);
Line: 515

    DBMS_SQL.PARSE(v_hold_cursorID, v_hold_final_select, DBMS_SQL.NATIVE);
Line: 516

    DBMS_SQL.PARSE(v_release_cursorID, v_release_final_select, DBMS_SQL.NATIVE);
Line: 637

           Insert_In_Temp_Table(f_release_header_id, 'PASS');
Line: 642

           Insert_In_Temp_Table(f_release_header_id, 'FAIL');
Line: 644

           Insert_In_Temp_Table(f_release_header_id, 'ERROR');
Line: 682

           Insert_In_Temp_Table(f_hold_header_id, 'PASS');
Line: 687

           Insert_In_Temp_Table(f_hold_header_id, 'FAIL');
Line: 689

           Insert_In_Temp_Table(f_hold_header_id, 'ERROR');
Line: 751

             Insert_In_Temp_Table(f_release_header_id, 'PASS');
Line: 756

             Insert_In_Temp_Table(f_release_header_id, 'FAIL');
Line: 758

             Insert_In_Temp_Table(f_release_header_id, 'ERROR');
Line: 794

             Insert_In_Temp_Table(f_hold_header_id, 'PASS');
Line: 799

             Insert_In_Temp_Table(f_hold_header_id, 'FAIL');
Line: 801

             Insert_In_Temp_Table(f_hold_header_id, 'ERROR');
Line: 835

    OE_DEBUG_PUB.ADD('Right before inserting into temp table');
Line: 839

      Insert_In_Temp_Table(p_header_id, 'PASS');
Line: 844

      Insert_In_Temp_Table(p_header_id, 'FAIL');
Line: 846

      Insert_In_Temp_Table(p_header_id, 'ERROR');
Line: 848

    OE_DEBUG_PUB.ADD('Release: Right after inserting into temp table');
Line: 863

    OE_DEBUG_PUB.ADD('Right before inserting into temp table');
Line: 867

      Insert_In_Temp_Table(p_header_id, 'PASS');
Line: 872

      Insert_In_Temp_Table(p_header_id, 'FAIL');
Line: 874

      Insert_In_Temp_Table(p_header_id, 'ERROR');
Line: 876

    OE_DEBUG_PUB.ADD('Hold: Right after inserting into temp table');
Line: 933

SELECT
  currency_code
FROM fnd_currencies
WHERE enabled_flag='Y'
  AND currency_flag='Y';
Line: 1663

SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_name BETWEEN p_party_name_low
                 AND NVL(p_party_name_high, party_name)
  AND party_number  BETWEEN NVL(p_party_number_low, party_number )
                 AND NVL(p_party_number_high, party_number )
  AND l_input = 1
UNION
SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_name <= p_party_name_high
  AND party_number  BETWEEN NVL(p_party_number_low, party_number )
                 AND NVL(p_party_number_high, party_number )
  AND l_input = 2
UNION
SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_number  BETWEEN p_party_number_low
                 AND NVL(p_party_number_high, party_number )
  AND l_input = 3
UNION
SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_number  <= p_party_number_high
  AND l_input = 4
; */
Line: 1714

SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_name BETWEEN p_party_name_low
                 AND NVL(p_party_name_high, party_name)
  AND party_number  BETWEEN NVL(p_party_number_low, party_number )
                 AND NVL(p_party_number_high, party_number )
  AND l_input = 1 ;
Line: 1728

SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_name <= p_party_name_high
  AND party_number  BETWEEN NVL(p_party_number_low, party_number )
                 AND NVL(p_party_number_high, party_number )
  AND l_input = 2;
Line: 1741

SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_number  BETWEEN p_party_number_low
                 AND NVL(p_party_number_high, party_number )
  AND l_input = 3;
Line: 1753

SELECT
  p.party_name||'('||p.party_number||')' Party
, p.party_id
, p.party_number
FROM
  hz_parties p
WHERE party_type IN ('ORGANIZATION','PERSON')
  AND party_number  <= p_party_number_high
  AND l_input = 4;
Line: 1772

SELECT
   p.party_name||'('||p.party_number||')' Party
 , n.child_id party_id
 , p.party_number party_number
 , NVL(n.level_number,0) level_number
 FROM
   hz_parties p, hz_hierarchy_nodes n
 WHERE p.party_id=n.child_id
   AND     n.parent_object_type           = 'ORGANIZATION'
   AND     n.parent_table_name            = 'HZ_PARTIES'
   AND     n.child_object_type            = 'ORGANIZATION'
   AND     n.effective_start_date          <= SYSDATE
   AND     n.effective_end_date            >= SYSDATE
   AND     n.hierarchy_type
                = OE_CREDIT_CHECK_UTIL.G_hierarchy_type
   AND n.parent_id=NVL(p_specific_party_id,p_spec_party_num_id)
 ORDER BY level_number;
Line: 1794

SELECT
   p.party_name||'('||p.party_number||')' Party
 , p.party_id
 , p.party_number party_number
 FROM
   hz_parties p
 WHERE p.party_id=NVL(p_specific_party_id,p_spec_party_num_id);
Line: 1806

SELECT
  cpa.currency_code party_currency_code
, cpa.overall_credit_limit party_overall_limit
FROM
  hz_customer_profiles cp
, hz_cust_profile_amts cpa
WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
  AND cp.site_use_id IS NULL
  AND cp.cust_account_id=-1
  AND cp.STATUS='A' --14699527
  AND cp.party_id=p_party_id;
Line: 1822

SELECT
  SUBSTRB(p.party_name,1,50) ||'('||c.account_number||')' Customer
, c.cust_account_id customer_id
, c.account_number customer_number
FROM
  hz_cust_accounts c
, hz_parties p
WHERE c.status='A'
  AND c.party_id = p.party_id
  AND p.party_id= p_party_id;
Line: 1838

SELECT
  SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
, c.cust_account_id customer_id
, c.account_number customer_number
FROM
  hz_cust_accounts c
, hz_parties party
WHERE c.status='A'
  AND c.party_id = party.party_id
  AND party.party_name BETWEEN NVL(p_customer_name_low, party.party_name )
                 AND NVL(p_customer_name_high, party.party_name)
  AND c.account_number  BETWEEN NVL(p_cust_number_low, c.account_number )
                 AND NVL(p_cust_number_high, c.account_number )
  AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                                 AND NVL(p_prof_class_high, cpc.name));
Line: 1861

SELECT
  cpa.currency_code cust_currency_code
, cpa.overall_credit_limit cust_overall_limit
FROM
  hz_customer_profiles cp
, hz_cust_profile_amts cpa
WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
  AND cp.site_use_id IS NULL
  AND cp.STATUS='A'--14699527
  AND cp.cust_account_id=p_customer_id;
Line: 1875

SELECT
  csu.location Customer_site
, csu.site_use_id site_id
, csu.cust_acct_site_id
FROM
  hz_cust_site_uses_all csu
,  hz_cust_acct_sites_all casa
WHERE csu.site_use_code='BILL_TO'
  AND csu.cust_acct_site_id=casa.cust_acct_site_id
  AND casa.cust_account_id=p_customer_id
  AND csu.org_id=p_org_id
  AND casa.org_id=p_org_id;
Line: 1892

SELECT
  cpa.currency_code site_currency_code
, cpa.overall_credit_limit site_overall_limit
FROM
  hz_customer_profiles cp
, hz_cust_profile_amts cpa
WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
  AND cp.site_use_id =p_site_id
  AND cp.STATUS='A' --14699527
  AND cp.cust_account_id=p_customer_id;
Line: 1946

  SELECT
    conversion_type
  INTO
    l_conversion_type
  FROM oe_credit_check_rules
  WHERE credit_check_rule_id=p_cr_check_rule_id;
Line: 2130

        OE_DEBUG_PUB.ADD('IN Insert data into temp table ');
Line: 2133

        INSERT INTO OE_CREDIT_EXPOSURE_TEMP
        ( party_id
        , party_name
        , party_number
        , party_level
        , party_parent_id
        , report_by_option
        , customer_id
        , customer_name
        , customer_number
        , bill_to_site_id
        , bill_to_site_name
        , credit_limit_currency
        , cr_cur_overall_limit
        , cr_cur_exposure
        , cr_cur_available
        , base_currency
        , base_cur_overall_limit
        , base_cur_exposure
        , base_cur_available
        , unchecked_exposure
        , global_exposure_flag
        )
        VALUES
        ( party_csr_rec.party_id
        , party_csr_rec.Party
        , party_csr_rec.party_number
        , NULL
        , NULL
        , 'PARTY_SUMMARY'
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , party_prof_csr_rec.party_currency_code
        , party_prof_csr_rec.party_overall_limit
        , l_party_total_exposure
        , l_party_available
        , l_base_currency
        , l_base_cur_overall_limit
        , l_base_cur_exposure
        , l_base_cur_available
        , NULL
        , l_global_exposure_flag
        );
Line: 2180

      OE_DEBUG_PUB.ADD('OUT Insert data into temp table ');
Line: 2235

     SELECT COUNT(*)
     INTO l_prof_count
     FROM
       hz_customer_profiles cp
     , hz_cust_profile_amts cpa
     WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
       AND cp.site_use_id IS NULL
       AND cp.cust_account_id=-1
	   AND cp.STATUS='A' --14699527
       AND cp.party_id=party_csr_rec.party_id;
Line: 2250

      OE_DEBUG_PUB.ADD('Update temp table with unchecked exposure ');
Line: 2253

      UPDATE oe_credit_exposure_temp
      SET unchecked_exposure=l_party_unchk_exposure
      WHERE party_id=party_csr_rec.party_id
        AND customer_id IS NULL;
Line: 2263

       OE_DEBUG_PUB.ADD('IN Insert data into temp table for unchecked exposure ');
Line: 2266

        INSERT INTO OE_CREDIT_EXPOSURE_TEMP
        ( party_id
        , party_name
        , party_number
        , party_level
        , party_parent_id
        , report_by_option
        , customer_id
        , customer_name
        , customer_number
        , bill_to_site_id
        , bill_to_site_name
        , credit_limit_currency
        , cr_cur_overall_limit
        , cr_cur_exposure
        , cr_cur_available
        , base_currency
        , base_cur_overall_limit
        , base_cur_exposure
        , base_cur_available
        , unchecked_exposure
        , global_exposure_flag
        )
        VALUES
        ( party_csr_rec.party_id
        , party_csr_rec.Party
        , party_csr_rec.party_number
        , NULL
        , NULL
        , 'PARTY_SUMMARY'
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , l_base_currency
        , NULL
        , NULL
        , NULL
        , l_party_unchk_exposure
        , NULL
        );
Line: 2313

       OE_DEBUG_PUB.ADD('Out Insert data into temp table ');
Line: 2357

    SELECT COUNT(*)
    INTO l_count_hierarchy
    FROM hz_hierarchy_nodes
    WHERE hierarchy_type=l_profile_value
      AND (parent_id = l_specific_party_id
        OR child_id=l_specific_party_id);
Line: 2470

          OE_DEBUG_PUB.ADD('IN Insert data into temp table ');
Line: 2473

          INSERT INTO OE_CREDIT_EXPOSURE_TEMP
          ( party_id
          , party_name
          , party_number
          , party_level
          , party_parent_id
          , report_by_option
          , customer_id
          , customer_name
          , customer_number
          , bill_to_site_id
          , bill_to_site_name
          , credit_limit_currency
          , cr_cur_overall_limit
          , cr_cur_exposure
          , cr_cur_available
          , base_currency
          , base_cur_overall_limit
          , base_cur_exposure
          , base_cur_available
          , unchecked_exposure
          , global_exposure_flag
          )
          VALUES
          ( party_hier_csr_rec.party_id
          , party_hier_csr_rec.Party
          , party_hier_csr_rec.party_number
          , party_hier_csr_rec.level_number
          , l_specific_party_id
          , 'PARTY_DETAILS'
          , NULL
          , NULL
          , NULL
          , NULL
          , NULL
          , party_prof_csr_rec.party_currency_code
          , party_prof_csr_rec.party_overall_limit
          , l_party_total_exposure
          , l_party_available
          , l_base_currency
          , l_base_cur_overall_limit
          , l_base_cur_exposure
          , l_base_cur_available
          , NULL
          , l_global_exposure_flag
          );
Line: 2520

        OE_DEBUG_PUB.ADD('OUT Insert data into temp table ');
Line: 2575

       SELECT COUNT(*)
       INTO l_prof_count
       FROM
         hz_customer_profiles cp
       , hz_cust_profile_amts cpa
       WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
         AND cp.site_use_id IS NULL
         AND cp.cust_account_id=-1
		 AND cp.STATUS='A' --14699527
         AND cp.party_id=party_hier_csr_rec.party_id;
Line: 2590

        OE_DEBUG_PUB.ADD('Update temp table with unchecked exposure ');
Line: 2593

        UPDATE oe_credit_exposure_temp
        SET unchecked_exposure=l_party_unchk_exposure
        WHERE party_id=party_hier_csr_rec.party_id
          AND customer_id IS NULL;
Line: 2603

         OE_DEBUG_PUB.ADD('IN Insert data into temp table for unchecked exposure ');
Line: 2606

         INSERT INTO OE_CREDIT_EXPOSURE_TEMP
         ( party_id
         , party_name
         , party_number
         , party_level
         , party_parent_id
         , report_by_option
         , customer_id
         , customer_name
         , customer_number
         , bill_to_site_id
         , bill_to_site_name
         , credit_limit_currency
         , cr_cur_overall_limit
         , cr_cur_exposure
         , cr_cur_available
         , base_currency
         , base_cur_overall_limit
         , base_cur_exposure
         , base_cur_available
         , unchecked_exposure
         , global_exposure_flag
         )
         VALUES
         ( party_hier_csr_rec.party_id
         , party_hier_csr_rec.Party
         , party_hier_csr_rec.party_number
         , party_hier_csr_rec.level_number
         , l_specific_party_id
         , 'PARTY_DETAILS'
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , l_base_currency
         , NULL
         , NULL
         , NULL
         , l_party_unchk_exposure
         , 'Y'
         );
Line: 2653

         OE_DEBUG_PUB.ADD('Out Insert data into temp table ');
Line: 2764

          OE_DEBUG_PUB.ADD('IN Insert data into temp table ');
Line: 2767

          INSERT INTO OE_CREDIT_EXPOSURE_TEMP
          ( party_id
          , party_name
          , party_number
          , party_level
          , party_parent_id
          , report_by_option
          , customer_id
          , customer_name
          , customer_number
          , bill_to_site_id
          , bill_to_site_name
          , credit_limit_currency
          , cr_cur_overall_limit
          , cr_cur_exposure
          , cr_cur_available
          , base_currency
          , base_cur_overall_limit
          , base_cur_exposure
          , base_cur_available
          , unchecked_exposure
          , global_exposure_flag
          )
          VALUES
          ( party_hier_csr_rec.party_id
          , party_hier_csr_rec.Party
          , party_hier_csr_rec.party_number
          , party_hier_csr_rec.level_number
          , l_specific_party_id
          , 'PARTY_DETAILS'
          , party_cust_csr_rec.customer_id
          , party_cust_csr_rec.Customer
          , party_cust_csr_rec.customer_number
          , NULL
          , NULL
          , cust_prof_csr_rec.cust_currency_code
          , cust_prof_csr_rec.cust_overall_limit
          , l_cust_total_exposure
          , l_cust_available
          , l_base_currency
          , l_base_cur_overall_limit
          , l_base_cur_exposure
          , l_base_cur_available
          , NULL
          , l_global_exposure_flag
          );
Line: 2814

        OE_DEBUG_PUB.ADD('OUT Insert data into temp table ');
Line: 2873

       SELECT COUNT(*)
       INTO l_prof_count
       FROM
         hz_customer_profiles cp
       , hz_cust_profile_amts cpa
       WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
         AND cp.site_use_id IS NULL
		 AND cp.STATUS ='A' --14699527
         AND cp.cust_account_id=party_cust_csr_rec.customer_id;
Line: 2887

        OE_DEBUG_PUB.ADD('Update temp table with unchecked exposure ');
Line: 2890

        UPDATE oe_credit_exposure_temp
        SET unchecked_exposure=l_cust_unchk_exposure
        WHERE customer_id=party_cust_csr_rec.customer_id
          AND party_id=party_hier_csr_rec.party_id
          AND bill_to_site_id IS NULL
          AND report_by_option='PARTY_DETAILS';
Line: 2902

         OE_DEBUG_PUB.ADD('IN Insert data into temp table for unchecked exposure ');
Line: 2905

          INSERT INTO OE_CREDIT_EXPOSURE_TEMP
          ( party_id
          , party_name
          , party_number
          , party_level
          , party_parent_id
          , report_by_option
          , customer_id
          , customer_name
          , customer_number
          , bill_to_site_id
          , bill_to_site_name
          , credit_limit_currency
          , cr_cur_overall_limit
          , cr_cur_exposure
          , cr_cur_available
          , base_currency
          , base_cur_overall_limit
          , base_cur_exposure
          , base_cur_available
          , unchecked_exposure
          , global_exposure_flag
          )
          VALUES
          ( party_hier_csr_rec.party_id
          , party_hier_csr_rec.Party
          , party_hier_csr_rec.party_number
          , party_hier_csr_rec.level_number
          , l_specific_party_id
          , 'PARTY_DETAILS'
          , party_cust_csr_rec.customer_id
          , party_cust_csr_rec.Customer
          , party_cust_csr_rec.customer_number
          , NULL
          , NULL
          , NULL
          , NULL
          , NULL
          , NULL
          , l_base_currency
          , NULL
          , NULL
          , NULL
          , l_cust_unchk_exposure
          , 'Y'
          );
Line: 2952

         OE_DEBUG_PUB.ADD('Out Insert data into temp table ');
Line: 3071

          OE_DEBUG_PUB.ADD('IN Insert data into temp table ');
Line: 3074

          INSERT INTO OE_CREDIT_EXPOSURE_TEMP
          ( party_id
          , party_name
          , party_number
          , party_level
          , party_parent_id
          , report_by_option
          , customer_id
          , customer_name
          , customer_number
          , bill_to_site_id
          , bill_to_site_name
          , credit_limit_currency
          , cr_cur_overall_limit
          , cr_cur_exposure
          , cr_cur_available
          , base_currency
          , base_cur_overall_limit
          , base_cur_exposure
          , base_cur_available
          , unchecked_exposure
          , global_exposure_flag
          )
          VALUES
          ( party_hier_csr1_rec.party_id
          , party_hier_csr1_rec.Party
          , party_hier_csr1_rec.party_number
          , 0
          , l_specific_party_id
          , 'PARTY_DETAILS'
          , NULL
          , NULL
          , NULL
          , NULL
          , NULL
          , party_prof_csr_rec.party_currency_code
          , party_prof_csr_rec.party_overall_limit
          , l_party_total_exposure
          , l_party_available
          , l_base_currency
          , l_base_cur_overall_limit
          , l_base_cur_exposure
          , l_base_cur_available
          , NULL
          , l_global_exposure_flag
          );
Line: 3121

        OE_DEBUG_PUB.ADD('OUT Insert data into temp table ');
Line: 3178

       SELECT COUNT(*)
       INTO l_prof_count
       FROM
         hz_customer_profiles cp
       , hz_cust_profile_amts cpa
       WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
         AND cp.site_use_id IS NULL
         AND cp.cust_account_id=-1
		 AND cp.STATUS='A'  --14699527
         AND cp.party_id=party_hier_csr1_rec.party_id;
Line: 3193

        OE_DEBUG_PUB.ADD('Update temp table with unchecked exposure ');
Line: 3196

        UPDATE oe_credit_exposure_temp
        SET unchecked_exposure=l_party_unchk_exposure
        WHERE party_id=party_hier_csr1_rec.party_id
          AND customer_id IS NULL;
Line: 3206

         OE_DEBUG_PUB.ADD('IN Insert data into temp table for unchecked exposure ');
Line: 3209

         INSERT INTO OE_CREDIT_EXPOSURE_TEMP
         ( party_id
         , party_name
         , party_number
         , party_level
         , party_parent_id
         , report_by_option
         , customer_id
         , customer_name
         , customer_number
         , bill_to_site_id
         , bill_to_site_name
         , credit_limit_currency
         , cr_cur_overall_limit
         , cr_cur_exposure
         , cr_cur_available
         , base_currency
         , base_cur_overall_limit
         , base_cur_exposure
         , base_cur_available
         , unchecked_exposure
         , global_exposure_flag
         )
         VALUES
         ( party_hier_csr1_rec.party_id
         , party_hier_csr1_rec.Party
         , party_hier_csr1_rec.party_number
         , 0
         , l_specific_party_id
         , 'PARTY_DETAILS'
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , NULL
         , l_base_currency
         , NULL
         , NULL
         , NULL
         , l_party_unchk_exposure
         , 'Y'
         );
Line: 3256

         OE_DEBUG_PUB.ADD('Out Insert data into temp table ');
Line: 3369

          OE_DEBUG_PUB.ADD('IN Insert data into temp table ');
Line: 3372

          INSERT INTO OE_CREDIT_EXPOSURE_TEMP
          ( party_id
          , party_name
          , party_number
          , party_level
          , party_parent_id
          , report_by_option
          , customer_id
          , customer_name
          , customer_number
          , bill_to_site_id
          , bill_to_site_name
          , credit_limit_currency
          , cr_cur_overall_limit
          , cr_cur_exposure
          , cr_cur_available
          , base_currency
          , base_cur_overall_limit
          , base_cur_exposure
          , base_cur_available
          , unchecked_exposure
          , global_exposure_flag
          )
          VALUES
          ( party_hier_csr1_rec.party_id
          , party_hier_csr1_rec.Party
          , party_hier_csr1_rec.party_number
          , 0
          , l_specific_party_id
          , 'PARTY_DETAILS'
          , party_cust_csr_rec.customer_id
          , party_cust_csr_rec.Customer
          , party_cust_csr_rec.customer_number
          , NULL
          , NULL
          , cust_prof_csr_rec.cust_currency_code
          , cust_prof_csr_rec.cust_overall_limit
          , l_cust_total_exposure
          , l_cust_available
          , l_base_currency
          , l_base_cur_overall_limit
          , l_base_cur_exposure
          , l_base_cur_available
          , NULL
          , 'Y'
          );
Line: 3419

        OE_DEBUG_PUB.ADD('OUT Insert data into temp table ');
Line: 3476

       SELECT COUNT(*)
       INTO l_prof_count
       FROM
         hz_customer_profiles cp
       , hz_cust_profile_amts cpa
       WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
         AND cp.site_use_id IS NULL
		 AND cp.STATUS='A' --14699527
         AND cp.cust_account_id=party_cust_csr_rec.customer_id;
Line: 3490

        OE_DEBUG_PUB.ADD('Update temp table with unchecked exposure ');
Line: 3493

        UPDATE oe_credit_exposure_temp
        SET unchecked_exposure=l_cust_unchk_exposure
        WHERE customer_id=party_cust_csr_rec.customer_id
          AND party_id=party_hier_csr1_rec.party_id
          AND bill_to_site_id IS NULL
          AND report_by_option='PARTY_DETAILS';
Line: 3505

         OE_DEBUG_PUB.ADD('IN Insert data into temp table for unchecked exposure ');
Line: 3508

          INSERT INTO OE_CREDIT_EXPOSURE_TEMP
          ( party_id
          , party_name
          , party_number
          , party_level
          , party_parent_id
          , report_by_option
          , customer_id
          , customer_name
          , customer_number
          , bill_to_site_id
          , bill_to_site_name
          , credit_limit_currency
          , cr_cur_overall_limit
          , cr_cur_exposure
          , cr_cur_available
          , base_currency
          , base_cur_overall_limit
          , base_cur_exposure
          , base_cur_available
          , unchecked_exposure
          , global_exposure_flag
          )
          VALUES
          ( party_hier_csr1_rec.party_id
          , party_hier_csr1_rec.Party
          , party_hier_csr1_rec.party_number
          , 0
          , l_specific_party_id
          , 'PARTY_DETAILS'
          , party_cust_csr_rec.customer_id
          , party_cust_csr_rec.Customer
          , party_cust_csr_rec.customer_number
          , NULL
          , NULL
          , NULL
          , NULL
          , NULL
          , NULL
          , l_base_currency
          , NULL
          , NULL
          , NULL
          , l_cust_unchk_exposure
          , 'Y'
          );
Line: 3555

         OE_DEBUG_PUB.ADD('Out Insert data into temp table ');
Line: 3582

	SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND party.party_name BETWEEN p_customer_name_low
                 AND NVL(p_customer_name_high, party.party_name)
          AND c.account_number  BETWEEN p_cust_number_low
                 AND NVL(p_cust_number_high, c.account_number )
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							   AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3606

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND party.party_name <= p_customer_name_high
          AND c.account_number  BETWEEN p_cust_number_low
                 AND NVL(p_cust_number_high, c.account_number )
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
								AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3629

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND party.party_name BETWEEN p_customer_name_low
                 AND NVL(p_customer_name_high, party.party_name)
          AND c.account_number  <=p_cust_number_high
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							 AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3652

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND party.party_name <= p_customer_name_high
          AND c.account_number <= p_cust_number_high
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							 AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3673

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND party.party_name BETWEEN p_customer_name_low
                 AND NVL(p_customer_name_high, party.party_name)
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							 AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3694

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND party.party_name <= p_customer_name_high
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							 AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3714

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND c.account_number  BETWEEN p_cust_number_low
                 AND NVL(p_cust_number_high, c.account_number )
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							 AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3735

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND c.account_number  <= p_cust_number_high
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							 AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3759

        SELECT
          SUBSTRB(party.party_name,1,50) ||'('||c.account_number||')' Customer
        , c.cust_account_id customer_id
        , c.account_number customer_number
        FROM
          hz_cust_accounts c
        , hz_parties party
        WHERE c.status='A'
          AND c.party_id = party.party_id
          AND c.cust_account_id IN (SELECT cp.cust_account_id
                             FROM hz_cust_profile_classes cpc,hz_customer_profiles cp
                             WHERE cp.profile_class_id=cpc.profile_class_id
							 AND cp.STATUS='A' --14699527
                               AND cpc.name BETWEEN NVL(p_prof_class_low, cpc.name)
                               AND NVL(p_prof_class_high, cpc.name)) ;
Line: 3880

        OE_DEBUG_PUB.ADD('IN Insert data into temp table ');
Line: 3883

        INSERT INTO OE_CREDIT_EXPOSURE_TEMP
        ( party_id
        , party_name
        , party_number
        , party_level
        , party_parent_id
        , report_by_option
        , customer_id
        , customer_name
        , customer_number
        , bill_to_site_id
        , bill_to_site_name
        , credit_limit_currency
        , cr_cur_overall_limit
        , cr_cur_exposure
        , cr_cur_available
        , base_currency
        , base_cur_overall_limit
        , base_cur_exposure
        , base_cur_available
        , unchecked_exposure
        , global_exposure_flag
        )
        VALUES
        ( NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , 'CUST_SUMMARY'
        , cust_csr_rec.customer_id
        , cust_csr_rec.Customer
        , cust_csr_rec.customer_number
        , NULL
        , NULL
        , cust_prof_csr_rec.cust_currency_code
        , cust_prof_csr_rec.cust_overall_limit
        , l_cust_total_exposure
        , l_cust_available
        , l_base_currency
        , l_base_cur_overall_limit
        , l_base_cur_exposure
        , l_base_cur_available
        , NULL
        , l_global_exposure_flag
        );
Line: 3930

      OE_DEBUG_PUB.ADD('OUT Insert data into temp table ');
Line: 3987

     SELECT COUNT(*)
     INTO l_prof_count
     FROM
       hz_customer_profiles cp
     , hz_cust_profile_amts cpa
     WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
       AND cp.site_use_id IS NULL
	   AND cp.STATUS='A' --14699527
       AND cp.cust_account_id=cust_csr_rec.customer_id;
Line: 4001

      OE_DEBUG_PUB.ADD('Update temp table with unchecked exposure ');
Line: 4004

      UPDATE oe_credit_exposure_temp
      SET unchecked_exposure=l_cust_unchk_exposure
      WHERE customer_id=cust_csr_rec.customer_id
        AND bill_to_site_id IS NULL
        AND party_id IS NULL;
Line: 4015

       OE_DEBUG_PUB.ADD('IN Insert data into temp table for unchecked exposure ');
Line: 4018

        INSERT INTO OE_CREDIT_EXPOSURE_TEMP
        ( party_id
        , party_name
        , party_number
        , party_level
        , party_parent_id
        , report_by_option
        , customer_id
        , customer_name
        , customer_number
        , bill_to_site_id
        , bill_to_site_name
        , credit_limit_currency
        , cr_cur_overall_limit
        , cr_cur_exposure
        , cr_cur_available
        , base_currency
        , base_cur_overall_limit
        , base_cur_exposure
        , base_cur_available
        , unchecked_exposure
        , global_exposure_flag
        )
        VALUES
        ( NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , 'CUST_SUMMARY'
        , cust_csr_rec.customer_id
        , cust_csr_rec.Customer
        , cust_csr_rec.customer_number
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , NULL
        , l_base_currency
        , NULL
        , NULL
        , NULL
        , l_cust_unchk_exposure
        , NULL
        );
Line: 4065

       OE_DEBUG_PUB.ADD('Out Insert data into temp table ');
Line: 4170

            INSERT INTO OE_CREDIT_EXPOSURE_TEMP
            ( party_id
            , party_name
            , party_number
            , party_level
            , party_parent_id
            , report_by_option
            , customer_id
            , customer_name
            , customer_number
            , bill_to_site_id
            , bill_to_site_name
            , credit_limit_currency
            , cr_cur_overall_limit
            , cr_cur_exposure
            , cr_cur_available
            , base_currency
            , base_cur_overall_limit
            , base_cur_exposure
            , base_cur_available
            , unchecked_exposure
            , global_exposure_flag
            )
            VALUES
            ( NULL
            , NULL
            , NULL
            , NULL
            , NULL
            , 'CUST_DETAILS'
            , cust_csr_rec.customer_id
            , cust_csr_rec.Customer
            , cust_csr_rec.customer_number
            , site_csr_rec.site_id
            , site_csr_rec.Customer_site
            , site_prof_csr_rec.site_currency_code
            , site_prof_csr_rec.site_overall_limit
            , l_site_total_exposure
            , l_site_available
            , l_base_currency
            , l_base_cur_overall_limit
            , l_base_cur_exposure
            , l_base_cur_available
            , NULL
            , 'N'
            );
Line: 4268

         SELECT COUNT(*)
         INTO l_prof_count1
         FROM
           hz_customer_profiles cp
         , hz_cust_profile_amts cpa
         WHERE cp.cust_account_profile_id=cpa.cust_account_profile_id
           AND cp.site_use_id =site_csr_rec.site_id
		   AND cp.STATUS='A' --14699527
           AND cp.cust_account_id=cust_csr_rec.customer_id;
Line: 4282

           OE_DEBUG_PUB.ADD('Update temp table with unchecked_exposure ');
Line: 4285

           UPDATE oe_credit_exposure_temp
           SET unchecked_exposure=l_site_unchk_exposure
           WHERE customer_id=cust_csr_rec.customer_id
             AND bill_to_site_id=site_csr_rec.site_id;
Line: 4295

           OE_DEBUG_PUB.ADD('Insert into temp table unchecked_exposure ');
Line: 4297

           INSERT INTO OE_CREDIT_EXPOSURE_TEMP
           ( party_id
           , party_name
           , party_number
           , party_level
           , party_parent_id
           , report_by_option
           , customer_id
           , customer_name
           , customer_number
           , bill_to_site_id
           , bill_to_site_name
           , credit_limit_currency
           , cr_cur_overall_limit
           , cr_cur_exposure
           , cr_cur_available
           , base_currency
           , base_cur_overall_limit
           , base_cur_exposure
           , base_cur_available
           , unchecked_exposure
           , global_exposure_flag
           )
           VALUES
           ( NULL
           , NULL
           , NULL
           , NULL
           , NULL
           , 'CUST_DETAILS'
           , cust_csr_rec.customer_id
           , cust_csr_rec.Customer
           , cust_csr_rec.customer_number
           , site_csr_rec.site_id
           , site_csr_rec.Customer_site
           , NULL
           , NULL
           , NULL
           , NULL
           , l_base_currency
           , NULL
           , NULL
           , NULL
           , l_site_unchk_exposure
           , 'N'
           );
Line: 4344

           OE_DEBUG_PUB.ADD('Out of the insert into temp table ');
Line: 4361

    DELETE
    FROM OE_CREDIT_EXPOSURE_TEMP;