ORA-06533: Subscript beyond count.

Hi ,
I am getting an error ORA-06533: Subscript beyond count.
I read a few post and tried extending the collections as suggested in various post but it doesnt seem to be helping.
Can anyone suggest where i am going wrong. below is my piece of code.
  PROCEDURE validate_records ( p_retcode                 OUT VARCHAR2
                             , p_errbuf                  OUT VARCHAR2
  IS
  g_ret_success                     CONSTANT  VARCHAR2(1)    := '0';
  g_ret_exception                   CONSTANT  VARCHAR2(1)    := '2';
  g_procedure                       VARCHAR2(30)             := g_validate_rec;
  l_batch_name                      ra_batch_sources_all.name%TYPE;
  l_supplier_payee_code             hz_cust_accounts_all.cust_account_id%TYPE;
  l_supplier_code                   hz_cust_accounts_all.cust_account_id%TYPE;
  l_term_name                       ra_terms.name%TYPE;
  l_term                            ra_terms.name%TYPE;
  l_receipt_method                  fnd_lookup_values.meaning%TYPE;
  l_func_seg                        fnd_flex_values_vl.attribute1%TYPE;
  l_tax_inc_flag                    fnd_flex_values_vl.attribute3%TYPE;
  l_set_of_books_id                 gl_ledgers.ledger_id%TYPE;
  l_cust_bill_to_add_ref            hz_cust_acct_sites.orig_system_reference%TYPE;
  l_cust_ship_to_add_ref            hz_cust_acct_sites.orig_system_reference%TYPE;
  l_costcenter                      fnd_flex_values_vl.attribute1%TYPE;
  l_company                         fnd_flex_values_vl.attribute2%TYPE;
  l_account                         fnd_flex_values_vl.attribute1%TYPE;
  l_function                        fnd_flex_values_vl.attribute2%TYPE;
  l_cust_trx_type_name              fnd_flex_values_vl.attribute4%TYPE;
  l_bill_sku                        fnd_flex_values_vl.attribute5%TYPE;
  l_ship_from                       fnd_flex_values_vl.attribute6%TYPE;
  l_inventory_id                    NUMBER;
  l_warehouse_id                    NUMBER;
  l_date                            DATE;
  l_date_term                       DATE;
  l_combination_check               VARCHAR2(10);
  l_location_ship                   VARCHAR2(10);
  l_location_bill                   VARCHAR2(10);
  l_line_type                       VARCHAR2(10);
  l_error_message                   VARCHAR2(4000);
  l_err_stage                       VARCHAR2(4000);
  l_return_status                   VARCHAR2(1);
  l_errbuf                          VARCHAR2(4000);
  l_retcode                         VARCHAR2(10);
  l_cnt                             NUMBER;
  l_update_tax                      VARCHAR2(1);
  l_error_count                     NUMBER;
  ex_dml_errors                     EXCEPTION;
  PRAGMA EXCEPTION_INIT(ex_dml_errors, -24381);
  CURSOR c_get_bill_data
      IS
  SELECT program_type
         , dc
         , CONCAT(supplier_code,'SMF') supplier_code1
         , CONCAT(substr(supplier_payee_code,0,4),'SMF')supplier_payee_code1
         , supplier_code
         , supplier_payee_code
         , line_type
         , payment_type
         , sfm_bill_number
         , due_date
         , ROUND(total_inv_recv_amt,2)  invoice_amount
         , record_status
         , ROWID
    FROM xxom_ar_sfs03_bill_info_stg
   WHERE record_status     = g_new_rec_status
     AND  conc_request_id  = fnd_global.conc_request_id;
  CURSOR c_new_rec_count
      IS
  SELECT COUNT(*)
    FROM xxom_ar_sfs03_bill_info_stg
   WHERE record_status      = g_new_rec_status
     AND conc_request_id    = fnd_global.conc_request_id;
-- to fetch total invoice lines for an invoice
  CURSOR c_get_invoice_no(p_bill in varchar2)
      IS
  SELECT sfm_bill_number
    FROM xxom_ar_sfs03_bill_info_stg
   WHERE sfm_bill_number   = p_bill
     AND conc_request_id   = fnd_global.conc_request_id;
-- to fetch total err lines for an invoice
  CURSOR c_get_err_line
      IS
  SELECT sfm_bill_number
    FROM xxom_ar_sfs03_bill_info_stg
   WHERE record_status    = 'E'
     AND conc_request_id  = fnd_global.conc_request_id;
  CURSOR c_batch_src_exist
      IS
  SELECT name
    FROM ra_batch_sources
   WHERE name                = g_batch_source_name
     AND batch_source_type   = 'FOREIGN'
     AND status              = 'A';
  CURSOR c_set_book_id_exist
      IS
  SELECT gl.ledger_id
    FROM gl_ledgers          gl
       , hr_operating_units  hru
   WHERE gl.ledger_id        = hru.set_of_books_id
     AND hru.organization_id = g_org_id
     AND gl.name             = g_ledger_name;
  CURSOR c_cust_num_exist( p_cust_no   IN hz_cust_accounts.orig_system_reference%TYPE
      IS
  SELECT cust_account_id 
    FROM hz_parties       HP 
       , hz_cust_accounts HCC 
   WHERE HP.party_id               = HCC.party_id 
     AND HP.status                 = 'A'
     AND HCC.status                = 'A'
     AND HCC.orig_system_reference LIKE p_cust_no;
    CURSOR c_cust_payee_exist( p_cust_no   IN hz_cust_accounts.attribute2%TYPE)
      IS
     SELECT cust_account_id 
    FROM hz_parties       HP 
       , hz_cust_accounts HCC 
   WHERE HP.party_id               = HCC.party_id 
     AND HP.status                 = 'A'
     AND HCC.status                = 'A'
     AND HCC.orig_system_reference = p_cust_no;
  CURSOR c_pgm_type_exist(p_pgm_type IN VARCHAR)
      IS
  SELECT FFVV.attribute1
       , FFVV.attribute2
       , FFVV.attribute3
       , FFVV.attribute4
       , FFVV.attribute5
       , FFVV.attribute6
   FROM fnd_flex_value_sets FFVS
      , fnd_flex_values_vl  FFVV
   WHERE flex_value_set_name    = g_pgm_valueset
     AND FFVV.flex_value_set_id = FFVS.flex_value_set_id
     AND FFVV.flex_value        = p_pgm_type
     AND enabled_flag           = 'Y'
     AND TRUNC(SYSDATE) BETWEEN NVL(start_date_active,TRUNC(SYSDATE))
                            AND NVL(end_date_active,TRUNC(SYSDATE));
  CURSOR c_validate_dc(p_dc IN fnd_flex_values_vl.flex_value%TYPE)
      IS 
  SELECT FFVV.attribute1
       , FFVV.attribute2
    FROM fnd_flex_value_sets FFVS
       , fnd_flex_values_vl  FFVV
   WHERE flex_value_set_name    = 'OM_LEGACY_DC'
     AND FFVV.flex_value_set_id = FFVS.flex_value_set_id
     AND FFVV.flex_value        = p_dc
     AND enabled_flag           = 'Y';
  CURSOR c_get_location( p_cust_id   IN hz_cust_accounts.cust_account_id%TYPE
                       , p_location_use  IN  VARCHAR2
      IS
  SELECT  HCAS.orig_system_reference
    FROM  hz_cust_acct_sites  HCAS
       ,  hz_cust_site_uses   HCSU
   WHERE  cust_account_id        = p_cust_id
     AND  HCAS.cust_acct_site_id = HCSU.cust_acct_site_id
     AND  HCAS.status            = 'A'
     AND  primary_flag           = 'Y'
     AND  HCSU.site_use_code     = p_location_use;
  CURSOR c_validate_line_type(p_line_type IN VARCHAR2)
      IS
  SELECT flv.lookup_code
    FROM fnd_lookup_values flv
   WHERE flv.lookup_type   = g_line_typ_lookup
     AND flv.lookup_code   = p_line_type
     AND flv.enabled_flag  = 'Y'
     AND TRUNC(SYSDATE) BETWEEN NVL(flv.start_date_active,TRUNC(SYSDATE))
                            AND NVL(flv.end_date_active,TRUNC(SYSDATE));
  CURSOR c_validate_receipt_type(p_receipt_method IN  VARCHAR2)
      IS
  SELECT flv.meaning
    FROM fnd_lookup_values flv
   WHERE flv.lookup_type   = g_receipt_lookup
     AND flv.lookup_code   = p_receipt_method
     AND flv.enabled_flag  = 'Y'
     AND TRUNC(SYSDATE) BETWEEN NVL(flv.start_date_active,TRUNC(SYSDATE))
                            AND NVL(flv.end_date_active,TRUNC(SYSDATE));
  CURSOR c_validate_term_name (p_term_name IN ra_terms.name%TYPE)
      IS
  SELECT name
    FROM ra_terms
   WHERE name = p_term_name
     AND TRUNC(SYSDATE) BETWEEN NVL(start_date_active,TRUNC(SYSDATE))
                            AND TRUNC(SYSDATE);
  CURSOR c_check_combination( p_attribute IN ra_customer_trx_all.attribute1%TYPE
      IS
  SELECT 1
    FROM ra_customer_trx_all
   WHERE attribute1         = p_attribute
     AND attribute_category = 'SFM';
  CURSOR c_get_inventory_item_id (p_org_code IN VARCHAR2
                                 ,p_item_description IN VARCHAR2)
    IS
  SELECT msi.inventory_item_id
       , msi.organization_id warehouse_id
    FROM mtl_system_items_b msi
       , hr_all_organization_units haou
       , org_organization_definitions ood
   WHERE  haou.organization_id  = msi.organization_id
     AND haou.organization_id   = ood.organization_id
     AND ood.disable_date IS NULL
     AND msi.enabled_flag       = 'Y'
     AND ood.organization_code  = p_org_code
     AND segment1               = p_item_description
     AND TRUNC(SYSDATE) BETWEEN NVL(msi.start_date_active,TRUNC(SYSDATE))
                            AND NVL(msi.end_date_active,TRUNC(SYSDATE));
  TYPE type_bill_dtl_update_tbl IS RECORD
    ledger_id                 gl_ledgers.ledger_id%TYPE                      
  , cust_ship_to_add_ref      hz_cust_acct_sites_all.orig_system_reference%TYPE
  , pay_term_name             ra_terms.name%TYPE
  , receipt_method            fnd_lookup_values.meaning%TYPE
  , cust_bill_to_add_ref      hz_cust_acct_sites_all.orig_system_reference%TYPE
  , company_seg               gl_code_combinations.segment1%TYPE
  , costcenter_seg            gl_code_combinations.segment2%TYPE
  , function_seg              gl_code_combinations.segment3%TYPE
  , account_seg               gl_code_combinations.segment4%TYPE
  , cust_trx_type             fnd_flex_values_vl.attribute4%TYPE
  , inventory_item_id         fnd_flex_values_vl.attribute5%TYPE
  , warehouse_id              fnd_flex_values_vl.attribute6%TYPE
  , tax_flag                  VARCHAR2(1)
  , invoice_amount            NUMBER
  , record_status             VARCHAR2(1)
  , error_message             VARCHAR2(1000)
  , row_id                    ROWID
  TYPE t_get_bill_data IS TABLE OF c_get_bill_data%ROWTYPE;
  l_get_bill_data t_get_bill_data:= t_get_bill_data() ;
  TYPE t_bill_dtl_update_tbl IS TABLE OF type_bill_dtl_update_tbl;-- INDEX BY BINARY_INTEGER;
  l_bill_dtl_update_rec t_bill_dtl_update_tbl:= t_bill_dtl_update_tbl() ;
  TYPE t_bill_no  IS TABLE OF c_get_invoice_no%ROWTYPE;
  l_bill_no t_bill_no;
  TYPE t_bill_err_lines  IS TABLE OF c_get_err_line%ROWTYPE;
  l_bill_err_lines t_bill_err_lines;
  BEGIN
  p_retcode                := g_ret_success;
  p_errbuf                 := NULL;
  g_procedure              := g_validate_rec;
  l_set_of_books_id        := NULL;
  l_cnt                    := 1;
  OPEN c_new_rec_count;
  FETCH c_new_rec_count INTO g_new_rec_count;
  CLOSE c_new_rec_count;
  OPEN c_get_bill_data;
  FETCH c_get_bill_data BULK COLLECT INTO l_get_bill_data;
  CLOSE c_get_bill_data;
  FOR i IN 1..l_get_bill_data.COUNT LOOP
   FND_FILE.PUT_LINE (FND_FILE.LOG,'count'||i);
  l_get_bill_data.EXTEND;
  l_return_status          := NULL;
  l_batch_name             := NULL;
  l_supplier_code          := NULL;
  l_supplier_payee_code    := NULL;
  l_cust_bill_to_add_ref   := NULL;
  l_cust_ship_to_add_ref   := NULL;
  l_line_type              := NULL;
  l_combination_check      := NULL;
  l_term_name              := NULL;
  l_receipt_method         := NULL;
  l_tax_inc_flag           := NULL;
  l_update_tax             := NULL;
  l_date_term              := NULL;
  l_date                   := NULL;
  l_term                   := NULL;
  l_cust_trx_type_name     := NULL;
  l_bill_sku               := NULL;
  l_ship_from              := NULL;
  l_inventory_id           := NULL;
  l_warehouse_id           := NULL;
  l_location_ship          := 'SHIP_TO';
  l_location_bill          := 'BILL_TO';
  l_err_stage              := NULL;
  l_error_message          := NULL;
  l_costcenter             := NULL;
  l_company                := NULL;
  l_account                := NULL; 
  l_function               := NULL;
  -- Validation for set_of_books and org_id
  l_err_stage := 'Validation for Set_of_books_id and org_id .' ;
  IF (g_ledger_name IS NOT NULL) AND (g_org_id IS NOT NULL) THEN
    OPEN c_set_book_id_exist;
    FETCH c_set_book_id_exist into l_set_of_books_id;
    CLOSE c_set_book_id_exist;
    IF l_set_of_books_id IS NULL THEN
      p_errbuf        := 'Please check the setup for set_of_books name'||g_ledger_name;
      p_retcode       := g_ret_exception;
      xxom_int_common.post_record_msg( p_message  => 'Please check the setup for set_of_books name :'||g_ledger_name
                                     , p_severity => xxom_int_common.c_level_error
    END IF;--set of books
  ELSE
    p_errbuf        := 'Please check the setup for set_of_books name'||g_ledger_name||'and org_id '||g_org_id||'cannot be null';
    p_retcode       := g_ret_exception;
    xxom_int_common.post_record_msg( p_message  => 'Please check the setup for set_of_books name'||g_ledger_name||'and org_id '||g_org_id||'cannot be null'
                                   , p_severity => xxom_int_common.c_level_error
  END IF;--Validation for set_of_books and org_id
  --Validation for batch name
  l_err_stage := 'Validation for batch name.' ;
  IF g_batch_source_name IS NOT NULL THEN
    OPEN c_batch_src_exist;
    FETCH c_batch_src_exist INTO l_batch_name ;
    CLOSE c_batch_src_exist;
    IF l_batch_name IS NULL THEN
      p_errbuf        := 'Please check the setup for batch_source_name'||g_batch_source_name;
      p_retcode       := g_ret_exception;
      xxom_int_common.post_record_msg( p_message  => 'Please check the setup for batch_source_name'||g_batch_source_name
                                     , p_severity => xxom_int_common.c_level_error
    END IF;
  END IF ;--l_get_bill_data(i).batch_source_name IS NOT NULL
  --Validation for supplier code
  l_err_stage := 'Validation for Supplier Code.';
  IF l_get_bill_data(i).supplier_code IS NOT NULL THEN
    OPEN c_cust_num_exist( p_cust_no => l_get_bill_data(i).supplier_code1
    FETCH c_cust_num_exist INTO l_supplier_code;
    CLOSE c_cust_num_exist;
    IF l_supplier_code IS NULL THEN
      l_error_message := l_error_message||'Supplier Code ('||l_get_bill_data(i).supplier_code||' ) is not valid.';
      xxom_int_common.post_record_msg( p_message  => 'Supplier Code is not valid : '||l_get_bill_data(i).supplier_code||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                     , p_severity => xxom_int_common.c_level_warning
    ELSE
      OPEN c_get_location( p_cust_id      => l_supplier_code
                         , p_location_use => l_location_ship);
      FETCH c_get_location INTO l_cust_ship_to_add_ref;
      CLOSE c_get_location;
      IF l_cust_ship_to_add_ref IS NULL THEN
        l_error_message := l_error_message||'Customer ship to location is null.';
        xxom_int_common.post_record_msg( p_message  => 'Customer ship to location is null. '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                       , p_severity => xxom_int_common.c_level_warning
      END IF;
    END IF ;
  END IF;-- l_get_bill_data(i).supplier_code IS NOT NULL
  --Validation for Supplier payee code
  l_err_stage := 'Validation for Supplier payee code.';
  IF l_get_bill_data(i).supplier_payee_code IS NOT NULL THEN
    OPEN c_cust_payee_exist ( p_cust_no => l_get_bill_data(i).supplier_payee_code1);
    FETCH c_cust_payee_exist INTO l_supplier_payee_code;
    CLOSE c_cust_payee_exist;
    IF l_supplier_payee_code IS NULL THEN
      l_error_message := l_error_message||'Supplier Payee Code ('||l_get_bill_data(i).supplier_payee_code||' ) is not valid.';
      xxom_int_common.post_record_msg( p_message  => 'Supplier Payee Code is not valid: '||l_get_bill_data(i).supplier_payee_code||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                     , p_severity => xxom_int_common.c_level_warning
    ELSE
      OPEN c_get_location( p_cust_id      => l_supplier_payee_code
                         , p_location_use => l_location_bill);
      FETCH c_get_location INTO l_cust_bill_to_add_ref;
      CLOSE c_get_location;
      IF l_cust_bill_to_add_ref IS NULL THEN
        l_error_message := l_error_message||'Customer bill to location is null.';
        xxom_int_common.post_record_msg( p_message  => 'Customer bill to location is null. '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                       , p_severity => xxom_int_common.c_level_warning
      END IF;
    END IF;
  ELSE
    l_error_message := l_error_message ||' Supplier Payee code is null';
    xxom_int_common.post_record_msg( p_message  => 'Supplier Payee code is null. '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                   , p_severity => xxom_int_common.c_level_warning
  END IF ;--supplier_payee_code IS NOT NULL
  --Validation for DC
  l_err_stage := 'Validation for DC.';
  IF l_get_bill_data(i).dc IS NOT NULL THEN
    OPEN c_validate_dc(p_dc => l_get_bill_data(i).dc);
    FETCH c_validate_dc INTO l_costcenter
                           , l_company;
    CLOSE c_validate_dc;
    IF l_costcenter IS NULL THEN
      l_error_message := l_error_message||'DC ('||l_get_bill_data(i).dc||' ) is not valid.';
      xxom_int_common.post_record_msg( p_message  => 'DC is not valid : '||l_get_bill_data(i).dc||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                     , p_severity => xxom_int_common.c_level_warning
    END IF;
  ELSE
    l_error_message := l_error_message||'DC is null';
    xxom_int_common.post_record_msg( p_message  => 'DC is null. '||l_get_bill_data(i).dc||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                   , p_severity => xxom_int_common.c_level_warning
  END IF;
  --Validation for program type
  l_err_stage := 'Validation for program type.';
  IF l_get_bill_data(i).program_type IS NOT NULL THEN
    OPEN c_pgm_type_exist(p_pgm_type => l_get_bill_data(i).program_type);
    FETCH c_pgm_type_exist INTO l_account
                              , l_function
                              , l_tax_inc_flag
                              , l_cust_trx_type_name
                              , l_bill_sku
                              , l_ship_from;
    CLOSE c_pgm_type_exist;
  --to fetch warehouse_id and inventory_id
    OPEN c_get_inventory_item_id(p_org_code => l_ship_from
                                ,p_item_description =>l_bill_sku  );                       
    FETCH c_get_inventory_item_id INTO l_inventory_id
                                      ,l_warehouse_id; 
    CLOSE c_get_inventory_item_id;
    IF l_tax_inc_flag IS NULL THEN
      l_error_message := l_error_message||'Program type ('||l_get_bill_data(i).program_type||' ) is not valid.';
      xxom_int_common.post_record_msg( p_message  => 'Program type is not valid : '||l_get_bill_data(i).program_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                     , p_severity => xxom_int_common.c_level_warning
    ELSIF l_tax_inc_flag ='No' THEN
      l_update_tax   := 'N';
    ELSE
      l_update_tax   := 'Y';
    END IF;
  ELSE
    l_error_message := l_error_message||'Program type is null';
    xxom_int_common.post_record_msg( p_message  => 'Program type is null. '||l_get_bill_data(i).program_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                   , p_severity => xxom_int_common.c_level_warning
  END IF; --IF l_get_bill_data.program_type IS NOT NULL
  --Validation for Line type
  l_err_stage := 'Validation for Line type.'; 
  IF l_get_bill_data(i).line_type IS NOT NULL THEN
    OPEN c_validate_line_type(p_line_type => l_get_bill_data(i).line_type);
    FETCH c_validate_line_type INTO l_line_type;
    CLOSE c_validate_line_type;
    IF l_line_type IS NULL THEN
      l_error_message := l_error_message||'Line type ('||l_get_bill_data(i).line_type||' ) is not valid.';
      xxom_int_common.post_record_msg( p_message  => 'Line type is not valid : '||l_get_bill_data(i).line_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                     , p_severity => xxom_int_common.c_level_warning
    END IF;
  ELSE
    l_error_message := l_error_message ||' Line type is null';
    xxom_int_common.post_record_msg( p_message  => 'Line type is null '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                   , p_severity => xxom_int_common.c_level_warning
  END IF;--l_get_bill_data(i).line_type IS NOT NULL
  --Validation for Payment Type
  l_err_stage := 'Validation for Payment Type.';
  IF l_get_bill_data(i).payment_type IS NOT NULL AND l_get_bill_data(i).payment_type IN ('D') THEN
  debug_print('Receipt'||i||l_get_bill_data(i).payment_type);
    OPEN c_validate_receipt_type(p_receipt_method => l_get_bill_data(i).payment_type);
    FETCH c_validate_receipt_type INTO l_receipt_method;
    CLOSE c_validate_receipt_type;
    IF l_receipt_method IS NULL THEN
      l_error_message := l_error_message||'Payment type ('||l_get_bill_data(i).payment_type||' ) is not valid.';
      xxom_int_common.post_record_msg( p_message  => 'Payment type is not valid : '||l_get_bill_data(i).payment_type||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                     , p_severity => xxom_int_common.c_level_warning
    END IF ;
  END IF;--l_get_bill_data(i).payment_type NOT NULL
  --Validation for term name
  IF l_get_bill_data(i).due_date IS NOT NULL THEN
    IF l_get_bill_data(i).due_date <= 0 THEN
      l_term_name:='IMMEDIATE';
    ELSIF l_get_bill_data(i).due_date BETWEEN 1 AND 30 THEN
      l_term_name:='NET30';
    ELSIF l_get_bill_data(i).due_date BETWEEN 31 AND 60 THEN
      l_term_name:='NET60';
    ELSIF l_get_bill_data(i).due_date BETWEEN 61 AND 90 THEN
      l_term_name:='NET90';
    ELSIF l_get_bill_data(i).due_date BETWEEN 91 AND 120 THEN
      l_term_name:='NET120';
    ELSIF l_get_bill_data(i).due_date BETWEEN 121 AND 150 THEN
      l_term_name:='NET150';
    ELSIF l_get_bill_data(i).due_date BETWEEN 151 AND 180 THEN
      l_term_name:='NET180';
    ELSIF l_get_bill_data(i).due_date BETWEEN 181 AND 210 THEN
      l_term_name:='NET210';
    ELSIF l_get_bill_data(i).due_date BETWEEN 211 AND 240 THEN
      l_term_name:='NET240';
    ELSE
      l_term_name:='NET365';
    END IF;  
    IF l_term_name IS NOT NULL THEN
      OPEN c_validate_term_name(p_term_name =>l_term_name);
      FETCH c_validate_term_name INTO l_term;
      CLOSE c_validate_term_name;
      IF l_term IS NULL THEN
        l_error_message := l_error_message ||'The term name is not a valid term';
        xxom_int_common.post_record_msg( p_message  => 'The term name is not a valid term '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                       , p_severity => xxom_int_common.c_level_warning
      END IF;
    END IF;--l_term_name IS NOT NULL THEN 
  ELSE
    l_error_message := l_error_message ||'The data provided for term name is null';
    xxom_int_common.post_record_msg( p_message  => 'The data provided for term name is null '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                   , p_severity => xxom_int_common.c_level_warning
  END IF; --l_get_bill_data(i).due_date IS NOT NULL */
  --Validation for unique interface_line_context and interface_line_attribute1 combination AND Amount
IF l_get_bill_data(i).invoice_amount IS NOT NULL THEN
    OPEN c_check_combination( p_attribute=> l_get_bill_data(i).sfm_bill_number
    FETCH c_check_combination INTO l_combination_check;
    CLOSE c_check_combination;
    IF l_combination_check IS NOT NULL THEN
      l_error_message := l_error_message||'The interface_line_context and interface_header_attribute1 combination ('||l_get_bill_data(i).sfm_bill_number||' and '|| ' SFM' ||' ) already exist .Please provide different combination';
      xxom_int_common.post_record_msg( p_message  => 'The interface_line_context and interface_header_attribute1 combination already exist .Please provide different combination ' ||l_get_bill_data(i).sfm_bill_number ||' and '||'SFM'
                                     , p_severity => xxom_int_common.c_level_warning
    END IF;
  ELSE
    l_error_message := l_error_message||'Amount cannot be null';
    xxom_int_common.post_record_msg( p_message  => 'Amount cannot be null '||' (Sfm Bill Number : '||l_get_bill_data(i).sfm_bill_number||')'
                                   , p_severity => xxom_int_common.c_level_warning
  END IF; --l_get_bill_data(i).total_inv_recv_amt IS NOT NULL 
  /* end of validation*/
  l_bill_dtl_update_rec.EXTEND;
  l_bill_dtl_update_rec(l_cnt).ledger_id              := l_set_of_books_id;
  l_bill_dtl_update_rec(l_cnt).cust_ship_to_add_ref   := l_cust_ship_to_add_ref;
  l_bill_dtl_update_rec(l_cnt).cust_bill_to_add_ref   := l_cust_bill_to_add_ref;
  l_bill_dtl_update_rec(l_cnt).receipt_method         := l_receipt_method;
  l_bill_dtl_update_rec(l_cnt).company_seg            := l_company;
  l_bill_dtl_update_rec(l_cnt).account_seg            := l_account;
  l_bill_dtl_update_rec(l_cnt).costcenter_seg         := l_costcenter;
  l_bill_dtl_update_rec(l_cnt).function_seg           := l_function;
  l_bill_dtl_update_rec(l_cnt).tax_flag               := l_update_tax;
  l_bill_dtl_update_rec(l_cnt).pay_term_name          := l_term;       
  l_bill_dtl_update_rec(l_cnt).cust_trx_type          := l_cust_trx_type_name;
  l_bill_dtl_update_rec(l_cnt).inventory_item_id      := l_inventory_id;
  l_bill_dtl_update_rec(l_cnt).warehouse_id           := l_warehouse_id;
  l_bill_dtl_update_rec(l_cnt).invoice_amount         := l_get_bill_data(i).invoice_amount;
  l_bill_dtl_update_rec(l_cnt).row_id                 := l_get_bill_data(i).rowid;
  IF l_error_message IS NULL THEN
    l_bill_dtl_update_rec(l_cnt).record_status           := g_valid_status;
    l_bill_dtl_update_rec(l_cnt).error_message           := NULL;
  ELSE
    l_bill_dtl_update_rec(l_cnt).record_status           := g_err_status;
    l_bill_dtl_update_rec(l_cnt).error_message           := l_error_message;
  END IF;
  l_cnt := l_cnt + 1;
  END LOOP;
  FORALL i in 1..l_bill_dtl_update_rec.COUNT SAVE EXCEPTIONS
  UPDATE xxom_ar_sfs03_bill_info_stg
     SET cust_bill_to_add_ref      = l_bill_dtl_update_rec(i).cust_bill_to_add_ref
       , cust_ship_to_add_ref      = l_bill_dtl_update_rec(i).cust_ship_to_add_ref
       , term_name                 = l_bill_dtl_update_rec(i).pay_term_name
       , receipt_method            = l_bill_dtl_update_rec(i).receipt_method
       , set_of_books_id           = l_bill_dtl_update_rec(i).ledger_id
       , company_seg               = l_bill_dtl_update_rec(i).company_seg
       , account_seg               = l_bill_dtl_update_rec(i).account_seg
       , costcenter_seg            = l_bill_dtl_update_rec(i).costcenter_seg
       , function_seg              = l_bill_dtl_update_rec(i).function_seg
       , cust_trx_type             = l_bill_dtl_update_rec(i).cust_trx_type  
       , inventory_item_id         = l_bill_dtl_update_rec(i).inventory_item_id
       , warehouse_id              = l_bill_dtl_update_rec(i).warehouse_id
       , tax_flag                  = l_bill_dtl_update_rec(i).tax_flag
       , total_inv_recv_amt        = l_bill_dtl_update_rec(i).invoice_amount
       , record_status             = l_bill_dtl_update_rec(i).record_status
       , error_message             = l_bill_dtl_update_rec(i).error_message
       , conc_request_id           = fnd_global.conc_request_id
       , last_update_date          = SYSDATE
       , last_updated_by           = FND_GLOBAL.USER_ID
   WHERE ROWID = l_bill_dtl_update_rec(i).row_id;
  COMMIT;
  -- Submitting the invoice_error procedure at end of validate procedure.
  debug_print('Submitting the invoice_error procedure at end of validate_records procedure. ');
  --reject all line of an invoice with a single error line
  OPEN c_get_err_line;
  FETCH c_get_err_line BULK COLLECT INTO  l_bill_err_lines;
  CLOSE c_get_err_line;
  FOR i IN 1..l_bill_err_lines.COUNT LOOP
OPEN c_get_invoice_no(p_bill =>l_bill_err_lines(i).sfm_bill_number );
FETCH c_get_invoice_no BULK COLLECT INTO  l_bill_no;
CLOSE c_get_invoice_no;
  FOR j IN 1..l_bill_no.COUNT LOOP
  UPDATE xxom_ar_sfs03_bill_info_stg
     SET error_message    = NULL
       , record_status    ='E'
       , last_update_date = SYSDATE
   WHERE record_status    = 'V'
     AND sfm_bill_number = l_bill_no(i).sfm_bill_number;
  COMMIT;
END LOOP;
END LOOP;
  EXCEPTION
    WHEN ex_dml_errors THEN
    l_error_count := SQL%BULK_EXCEPTIONS.count;
    FOR i IN 1 .. l_error_count LOOP
     l_error_message := l_error_message||SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE);
    END LOOP;--OR i IN 1 .. l_error_count LOOP
    WHEN OTHERS THEN
      IF c_get_bill_data%ISOPEN THEN
        CLOSE c_get_bill_data;
      END IF;
    IF c_batch_src_exist%ISOPEN THEN
      CLOSE c_batch_src_exist;
    END IF;
    IF c_set_book_id_exist%ISOPEN THEN
     CLOSE c_set_book_id_exist;
    END IF;
    IF c_get_location%ISOPEN THEN
      CLOSE c_get_location;
    END IF;
    IF c_validate_line_type%ISOPEN THEN
     CLOSE c_validate_line_type;
    END IF;
    IF c_validate_receipt_type%ISOPEN THEN
     CLOSE c_validate_receipt_type;
    END IF;
    IF c_check_combination%ISOPEN THEN
     CLOSE c_check_combination;
    END IF;
    IF c_validate_receipt_type%ISOPEN THEN
     CLOSE c_validate_receipt_type;
    END IF;
    IF c_pgm_type_exist%ISOPEN THEN
     CLOSE c_pgm_type_exist;
    END IF;
    IF c_validate_term_name%ISOPEN THEN
     CLOSE c_validate_term_name;
    END IF;
    IF c_new_rec_count%ISOPEN THEN
     CLOSE c_new_rec_count;
    END IF;
    IF c_cust_payee_exist%ISOPEN THEN
     CLOSE c_cust_payee_exist;
    END IF;
    IF c_get_invoice_no%ISOPEN THEN
     CLOSE c_get_invoice_no;
    END IF;
    IF c_get_err_line%ISOPEN THEN
      CLOSE c_get_err_line;
    END IF;
  p_retcode := g_ret_exception;
  p_errbuf  := 'The Error at XXOM_SFS_03_BILL_INFO_PKG.validate_records ' || l_err_stage|| '-'|| SUBSTR ( SQLERRM ,1,240 );
  END validate_records;
Thanks in advance.

Another version
SET SERVEROUTPUT ON
DECLARE
   TYPE empno_nt IS TABLE OF VARCHAR2 (40);
   l_empno_nt   empno_nt;
BEGIN
   l_empno_nt := empno_nt ('Suri');
   dbms_output.put_line(l_empno_nt(1));
END;
Enhanced version:
DECLARE
   TYPE empno_nt IS TABLE OF VARCHAR2 (40);
   l_empno_nt   empno_nt;
BEGIN
   l_empno_nt := empno_nt ('Suri', 'Test','Ranit');
   FOR rec IN l_empno_nt.FIRST .. l_empno_nt.LAST
   LOOP
      DBMS_OUTPUT.put_line (l_empno_nt (rec));
   END LOOP;
END;
Simplified version :
select * from table( sys.odcivarchar2list('Suri','Test','Ranit') ) ;
Cheers,
Manik.
Message was edited by: Manik

Similar Messages

  • SDO_TUNE.EXTENT_OF returns ORA-06533: Subscript beyond count

    Hi,
    I'm trying to get the MBR of a dataset I've just loaded via an Oracle dump file from another source. I am using sdo_tune.extent_of to get the information, but the following error message is returned:
    select sdo_tune.extent_of('LR_PRM_IACS','GEOM') from dual
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at "MDSYS.SDO_TUNE", line 1410
    I've looked up the meaning of the error and am none the wiser. There are just over 790000 records in the table. This shouldn't be too big to be handled, or is this possible? How else can I get the MBR for the dataset?
    Many thanks
    Sharon

    Hi Andriy
    I am Jorge Barba
    The author of the note you are following to setup the NCI demo.
    1. Regarding errors in sql*loader: Total logical records rejected: 55844
    We are aware of that and we just ignored those errors as this was done just for demo purposes.
    2. Regarding the second error
    Can you try the procedure in the tutorial, Use this link to go to the tutorial, build_patients sections:
    http://www.oracle.com/technology/obe/11gr1_db/datamgmt/nci_semantic_network/nci_semantics_les01.htm#t3
    If this still gives error, try the query alone to see if still gives the same error
    Regards!
    Jorge

  • Error: ORA-06533: Subscript beyond count

    when i run the below command;
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at line 10
    sp_table will be like
    SPLITID DELIMITERLENGTH
    1 1
    2 1
    3 1
    4 1
    declare strx varchar2(4000) :='11111111111111111111111111111111111111111111111111111111111111111111111111111111';
    delarray np_type:=np_type(1,2,3,4,5);
    execstr varchar2(4000);
    cn cn_type :=cn_type();
    cxn cxn_type :=cxn_type();
    xpos number:=1;
    begin
    for i in 1..5 loop
    select Delimiterlength into cn(i) from sp_table where Splitid = delarray(i);
    select substr(strx,xpos,cn(i)) into cxn(i) from dual;
    execstr:='insert into test values(' || cxn(i) || ',';
    xpos:=length(cxn(i));
    end loop;
    execstr:=substr(execstr,1,length(execstr)-1);
    execstr:=execstr || ')';
    dbms_output.put_line(execstr);
    --execute immediate execstr;
    end;
    /

    Something like this?
    SET SERVEROUTPUT ON
    DROP TABLE sp_table;
    CREATE TABLE sp_table(splitid NUMBER,delimiterlength NUMBER);
    INSERT INTO sp_table values(1,4);
    INSERT INTO sp_table values(2,7);
    INSERT INTO sp_table values(3,9);
    INSERT INTO sp_table values(4,1);
    INSERT INTO sp_table values(5,2);
    INSERT INTO sp_table values(6,6);
    COMMIT;
    DECLARE
        TYPE varchar2_table IS TABLE OF VARCHAR2(120)
            INDEX BY BINARY_INTEGER;
        TYPE number_table IS TABLE OF NUMBER
            INDEX BY BINARY_INTEGER;
        delarray    number_table;
        cn          number_table;
        cxn         varchar2_table;
        xpos        NUMBER  :=1;
        strx        VARCHAR2(4000) :='11111111111111111111111111111111111111111111111111111111111111111111111111111111';
        execstr     VARCHAR2(4000);
    BEGIN
        delarray(1) := 1;
        delarray(2) := 2;
        delarray(3) := 3;
        delarray(4) := 4;
        delarray(5) := 5;
        execstr := 'insert into test values(';
        FOR i IN 1..delarray.COUNT LOOP
            SELECT  delimiterlength
            INTO    cn(i)
            FROM    sp_table
            WHERE   splitid = delarray(i);
            cxn(i)  := SUBSTR(strx,xpos,cn(i));
            execstr :=execstr || cxn(i) || ',';
            xpos    :=LENGTH(cxn(i));
        END LOOP;
        execstr := RTRIM(execstr,',')|| ')';
        dbms_output.put_line(execstr);
        --execute immediate execstr;
    END;
    insert into test values(1111,1111111,111111111,1,11)I used associative arrays, so I don't have to extend them.
    Edited by: Marwim on 25.10.2012 10:17

  • Varray ORA-06533: Subscript beyond count

    Hi all
    In my package body i've declared
    create or replace package body mng_res_pack
    is
    TYPE rest_ans_type IS VARRAY(5) OF NUMBER(1);
    rest_ans rest_ans_type:=rest_ans_type();
    PROCEDURE fetch_rest_data
    IS
    rest_rec restore_users%ROWTYPE;
    MONE NUMBER :=0;
    BEGIN
    FOR I IN 1..5
    LOOP
    DBMS_OUTPUT.PUT_LINE ('HERE'||' '||rest_ans(i));
    END LOOP;
    end fetch_rest_data;
    end mng_res_pack;when i'm running the procedure i'm getting the error
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at "MNG_RES_PACK", line 46
    why ?
    the varray size is 5 , and i've also initialized it ?
    please Help
    Thanks In Advanced
    Naama

    >
    even though i didn't initialize the varray with numbers , i stil i declare it as a size of 5 .
    i still don't understand why it write that it out of limit. null is only the value , not the size of the varray.
    It should have looped 5 times and display null , no ?
    >
    No - the VARRAY itself is NULL - meaning there are no entries to access. You can't loop through the entries because there aren't any.
    The declared size of 5 is simply the maximum number of entries the VARRAY can ever have - but it does not create any entries; you have to do that.
    See Varrays in the PL/SQL language doc
    http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/composites.htm#CHDEIJHD
    >
    An uninitialized varray variable is a null collection. You must initialize it, either by making it empty or by assigning a non-NULL value to it. For details, see "Collection Constructors" and "Assigning Values to Collection Variables".

  • Error ORA-06533: Subscript beyond count - Please help

    Hi All,
    Please help me on below error
    I Created two Objects and two Type like below
    CREATE OR REPLACE TYPE P_IN_OBJ AS OBJECT
    A1 VARCHAR2(5),
    A2 VARCHAR2(5),
    A3 VARCHAR2(30));
    CREATE OR REPLACE TYPE P_IN AS TABLE OF P_IN_OBJ;
    CREATE OR REPLACE TYPE P_OUT_OBJ AS OBJECT
    (B1 VARCHAR2(1),
    B2 VARCHAR2(100),
    B3 NUMBER,
    B4 VARCHAR2(100));
    CREATE OR REPLACE TYPE P_OUT AS TABLE OF P_OUT_OBJ;
    CREATE OR REPLACE PACKAGE PKG_P1 AS
    PROCEDURE PRC_P1(P_IN_VALUE IN P_IN ,
    P_OUT_VALUE OUT P_OUT);
    END PKG_P1;
    CREATE OR REPLACE PACKAGE BODY PKG_SEG_QS AS
    PROCEDURE PRC_SEG_QS(P_IN_VALUE IN P_IN ,
    P_OUT_VALUE OUT P_OUT ) AS
    P_OUT_VAL P_OUT := P_OUT();
    element INTEGER := 1;
    BEGIN
    IF P_IN_VALUE.EXISTS(1) = TRUE THEN
    FOR I IN 1..P_IN_VALUE.COUNT
    LOOP
    FOR ALL_QS IN
    (SELECT E1, E2, E3, E4
    FROM MV_SEG_QS MVSQ
    WHERE MVSQ.Z1 = P_IN_VALUE.A1
    AND MVSQ.Z2 = P_IN_VALUE.A2
    AND MVSQ.Z3 = P_IN_VALUE.A3
    LOOP
    P_OUT_VAL(element).B1 := ALL_QS.E1;
    P_OUT_VAL(element).B2 := ALL_QS.E2;
    P_OUT_VAL(element).B3 := ALL_QS.E3;
    P_OUT_VAL(element).B4 := ALL_QS.E4;
    element := element+1;
    END LOOP;
    END LOOP;
    END IF;
    P_OUT_VALUE:= P_SEG_OUT;
    END PRC_P1;
    END PKG_P1;
    When I call this Package I am getting the below Error
    ORA-06533: Subscript beyond count
    Please somebody help me in this issue its very urgent for me.
    Thanks,
    Anu.

    Anu wrote:
    Hi All,
    Please help me on below error
    I Created two Objects and two Type like below
    CREATE OR REPLACE TYPE P_IN_OBJ AS OBJECT
    A1 VARCHAR2(5),
    A2 VARCHAR2(5),
    A3 VARCHAR2(30));
    CREATE OR REPLACE TYPE P_IN AS TABLE OF P_IN_OBJ;
    CREATE OR REPLACE TYPE P_OUT_OBJ AS OBJECT
    (B1 VARCHAR2(1),
    B2 VARCHAR2(100),
    B3 NUMBER,
    B4 VARCHAR2(100));
    CREATE OR REPLACE TYPE P_OUT AS TABLE OF P_OUT_OBJ;
    CREATE OR REPLACE PACKAGE PKG_P1 AS
    PROCEDURE PRC_P1(P_IN_VALUE IN P_IN ,
    P_OUT_VALUE OUT P_OUT);
    END PKG_P1;
    CREATE OR REPLACE PACKAGE BODY PKG_SEG_QS AS
    PROCEDURE PRC_SEG_QS(P_IN_VALUE IN P_IN ,
    P_OUT_VALUE OUT P_OUT ) AS
    P_OUT_VAL P_OUT := P_OUT();
    element INTEGER := 1;
    BEGIN
    IF P_IN_VALUE.EXISTS(1) = TRUE THEN
    FOR I IN 1..P_IN_VALUE.COUNT
    LOOP
    FOR ALL_QS IN
    (SELECT E1, E2, E3, E4
    FROM MV_SEG_QS MVSQ
    WHERE MVSQ.Z1 = P_IN_VALUE.A1
    AND MVSQ.Z2 = P_IN_VALUE.A2
    AND MVSQ.Z3 = P_IN_VALUE.A3
    LOOP
    P_OUT_VAL(element).B1 := ALL_QS.E1;
    P_OUT_VAL(element).B2 := ALL_QS.E2;
    P_OUT_VAL(element).B3 := ALL_QS.E3;
    P_OUT_VAL(element).B4 := ALL_QS.E4;
    element := element+1;
    END LOOP;
    END LOOP;
    END IF;
    P_OUT_VALUE:= P_SEG_OUT;
    END PRC_P1;
    END PKG_P1;
    When I call this Package I am getting the below Error
    ORA-06533: Subscript beyond count
    Please somebody help me in this issue its very urgent for me.
    Thanks,
    Anu.Anu,
    Correct your package code, its not working.
    Cheers,
    Manik.

  • ORA -06533 Subscript beyond control

    Hi folks,
    I got ORA -06533 Subscript beyond control .Please help me out.
    create or replace procedure p_mon_ext is
    type p_mon_type is varray(25) of varchar2(25);
    p_mon p_mon_type;
    idx number := 1;
    begin
    p_mon := p_mon_type();
         for i in 1..12
         loop
    select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
    p_mon.extend;
    end loop;
    forall i in 1..p_mon.count
         insert into t1 values (p_mon(i));
         commit;
    end;

    EXTEND has to precede any operations with elements:
    SQL> edit
    Wrote file afiedt.buf
      1  create or replace procedure p_mon_ext is
      2  type p_mon_type is varray(25) of varchar2(25);
      3  p_mon p_mon_type;
      4  idx number := 1;
      5  begin
      6  p_mon := p_mon_type();
      7  for i in 1..12
      8  loop
      9  select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
    10  p_mon.extend;
    11  end loop;
    12* end;
    SQL> /
    Procedure created.
    SQL> exec p_mon_ext
    BEGIN p_mon_ext; END;
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at "SCOTT.P_MON_EXT", line 9
    ORA-06512: at line 1
    SQL> edit
    Wrote file afiedt.buf
      1  create or replace procedure p_mon_ext is
      2  type p_mon_type is varray(25) of varchar2(25);
      3  p_mon p_mon_type;
      4  idx number := 1;
      5  begin
      6  p_mon := p_mon_type();
      7  for i in 1..12
      8  loop
      9  p_mon.extend;
    10  select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
    11  end loop;
    12* end;
    SQL> /
    Procedure created.
    SQL> exec p_mon_ext
    PL/SQL procedure successfully completed.
    SQL> edit
    Wrote file afiedt.buf
      1  create or replace procedure p_mon_ext is
      2  type p_mon_type is varray(25) of varchar2(25);
      3  p_mon p_mon_type;
      4  idx number := 1;
      5  begin
      6  p_mon := p_mon_type();
      7  p_mon.extend(12);
      8  for i in 1..12
      9  loop
    10  select to_char(SYSDATE, 'MONTH') into p_mon(i) from Dual;
    11  end loop;
    12* end;
    SQL> /
    Procedure created.
    SQL> exec p_mon_ext
    PL/SQL procedure successfully completed.Rgds.

  • Subscript beyond count ORA-06533

    Hi,
    I am using Oracle Express with SQL Developer on platform XP.
    I am attempting to run a procedure that works error free as an anonymous PL/SQL block.
    I have come across a few problems today and would like to Thank the following,
    1. Mohana - creating a type.
    2. MScallion - Grant Write suggestion.
    3. Billy Verreynne - adjusting my VARCHAR2 to correct bytes.
    I have been able to remove other errors with the help of the Oracle Forum Search but am gezumped by this one,
    Connecting to the database MY_DATABASE.
    ORA-06533: Subscript beyond count
    ORA-06512: at "MY_DATABASE.WRITE_MY_DDL", line 24
    ORA-06512: at line 12
    Process exited.
    Disconnecting from the database MY_DATABASE.
    This is the type I have created (now with revised VARCHAR2(4000)) ...
    create or replace TYPE PTB_NUMBER IS TABLE OF VARCHAR2(4000);
    This is the procedure I am attempting to run it compiles no worries (Thats what the message log tells me),
    create or replace
    PROCEDURE WRITE_MY_DDL
    ( v_object_type OUT VARCHAR2
    , v_sqlEnd OUT VARCHAR2
    , l_clob OUT CLOB
    , n OUT NUMBER
    , v_version OUT NUMBER
    , ptb_object_type OUT ptb_number
    , v_file_open OUT UTL_FILE.FILE_TYPE
    , v_file_name OUT VARCHAR2
    ) AS
    BEGIN
    n := 14;
    ptb_object_type := ptb_number();
    SELECT max(version)
    INTO v_version
    FROM my_ddl;
    v_file_name := 'DB_SCRIPT_FOR_'||USER||'_VERSION_'||v_version||'.sql';
    v_file_open := utl_file.FOPEN('SCRIPT_DIR',v_file_name,'w');
    ptb_object_type(1) := 'SEQUENCE';
    ptb_object_type(2) := 'TABLE';
    ptb_object_type(3) := 'TRIGGER';
    ptb_object_type(4) := 'PRIMARY KEY';
    ptb_object_type(5) := 'FORIEGN KEY';
    ptb_object_type(6) := 'PROCEDURE';
    ptb_object_type(7) := 'FUNCTION';
    ptb_object_type(8) := 'VIEW';
    ptb_object_type(9) := 'SELECT';
    ptb_object_type(10) := 'INSERT';
    ptb_object_type(11) := 'UPDATE';
    ptb_object_type(12) := 'DELETE';
    ptb_object_type(13) := 'REFERENCES';
    ptb_object_type(14) := 'EXECUTE';
    FOR loop_int IN 1 .. n
    LOOP
    v_object_type := ptb_object_type(loop_int);
    utl_file.PUT_LINE(v_file_open,' ');
    utl_file.PUT_LINE(v_file_open,'PROMPT CREATE '|| v_object_type ||'S' );
    utl_file.PUT_LINE(v_file_open,' ');
    utl_file.PUT_LINE(v_file_open,' ');
    FOR c1 IN
    (SELECT ROWID
    , object_type, object_name
    FROM my_ddl
    WHERE object_type = v_object_type
    AND version = v_version
    AND status = 'CURRENT'
    LOOP
    utl_file.PUT_LINE(v_file_open,'PROMPT CREATE ' ||USER|| ' '||c1.object_type||' '||c1.object_name);
    EXECUTE IMMEDIATE 'SELECT ddl FROM my_ddl WHERE ROWID = '|| ''''|| c1.ROWID ||''''
    INTO l_clob;
    utl_file.PUT_LINE(v_file_open, l_clob);
    END LOOP;
    END LOOP;
    utl_file.FCLOSE(v_file_open);
    END WRITE_MY_DDL;
    Cheers
    Ben

    ???(Not tested)
    BEGIN
    n := 14;
    ptb_object_type := ptb_number();
    ptb_object_type.extend(14);

  • Regarding error : Subscript beyond count

    PROCEDURE up_value_set_blk(p_upload_phase IN VARCHAR2 DEFAULT NULL,      
                               p_upload_mode IN VARCHAR2,
                               p_custom_mode IN VARCHAR2 DEFAULT NULL) is
                    cursor cur_flex_load is select * from value_set_stg;
                    type fnd_flex_set_type is table of fnd_flex_value_sets%rowtype;
                    type value_set_stg_type is table of value_set_stg%rowtype;
                    value_set_t value_set_stg_type;
                    fnd_flex_t fnd_flex_set_type := fnd_flex_set_type();
    BEGIN
            open cur_flex_load;
            fetch cur_flex_load bulk collect into value_set_t;
            FOR i in value_set_t.first..value_set_t.last LOOP
                 IF (get_vst_set(p_flex_value_set_name => value_set_t(i).flex_value_set_name,
                             x_vst_set => fnd_flex_t(i))) THEN     
                                  NULL;
                 END IF; 
             END LOOP;
    END;        
    exec up_value_set_blk('BEGIN','NLS','FORCE');
    BEGIN up_value_set_blk('BEGIN','NLS','FORCE'); END;
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at "APPS.FND_FLEX_LOADER_APIS_BLK"
    ORA-06512: at line 1
           The error occurs coz of this stmt
    get_vst_set(p_flex_value_set_name => value_set_t(i).flex_value_set_name, x_vst_set => fnd_flex_t(i))
    Let me know what should be done ?

    I didn't understand what was meant
    Let me be more clear
    desc fnd_flex_value_sets
    Name                                      Null?    Type
    FLEX_VALUE_SET_ID                         NOT NULL NUMBER(10)
    FLEX_VALUE_SET_NAME                       NOT NULL VARCHAR2(60)
    LAST_UPDATE_DATE                          NOT NULL DATE
    LAST_UPDATED_BY                           NOT NULL NUMBER(15)
    CREATION_DATE                             NOT NULL DATE
    CREATED_BY                                NOT NULL NUMBER(15)
    LAST_UPDATE_LOGIN                         NOT NULL NUMBER(15)
    FUNCTION get_vst_set(p_flex_value_set_name IN VARCHAR2,
                         x_vst_set OUT nocopy vst_set_type)
      RETURN BOOLEAN IS                                                            
         l_func_name VARCHAR2(80);                             
    BEGIN                              
       SELECT * INTO x_vst_set FROM fnd_flex_value_sets WHERE flex_value_set_name = p_flex_value_set_name;
       RETURN TRUE;     
    EXCEPTION
       WHEN no_data_found THEN
          RETURN FALSE;                                          
    END get_vst_set; This is what get_vst_set does ?
    Let me know how to proceed

  • Subscript beyond count

    Hello.
    I have a problem querying cube data in BI Answer and I need urgent help.
    I use OWB 10r2 to create cube, but when I deploy cube I receive this error:
    ORA-06533:Subscript beyond count
    ORA-06512:at "OLAPSYS.DBMS_ODM"
    Please help me.

    Hi ,
    From the error message ,it seems to me that it is DB related .
    What is the Database Version you are using ?
    Try with Oracle 10.2.0.3 or more .
    Thanks,
    Sutirtha

  • Subscript beyond count problem

    java.sql.SQLException: ORA-20001: Napaka: - -6533 -ERROR- ORA-06533: Subscript beyond count
    ORA-06512: at "TESTOD.VRNI_PODATKE", line 66
    ORA-06512: at "TESTOD.VRNI_PODATKE", line 111
    ORA-06512: at "TESTOD.VRNI_PODATKE", line 111
    ORA-06512: at "TESTOD.VRNI_PODATKE", line 111
    ORA-06512: at "TESTOD.DOKUMENTACIJA", line 448
    ORA-06512: at line 1
    line: 66:
    o1 := ob(stevec , ref_tabela, pk_tabele, tab_obj);
    begin
    IF o1 IS NOT NULL THEN
    v_table(st) := o1; -- HERE IS ERROR
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001, 'Napaka: - ' ||SQLCODE||' -ERROR- '||SQLERRM);
    end;
    v_table is parameter of IN OUT nocopy varray_data
    varray_data is pl/sql type:
    create or replace TYPE varray_data AS VARRAY(1000) OF ob1
    ob1 is pl/sql type:
    create or replace TYPE ob1 AS OBJECT(indeks NUMBER,
    name_table VARCHAR2(200),
    name_column VARCHAR2(200),
    tabela ob)
    create or replace TYPE ob IS VARRAY(100) OF ob2
    create or replace TYPE ob2 AS OBJECT(column VARCHAR2(200),
    imp_column VARCHAR2(200),
    ref_indeks NUMBER)
    line 111:
    st_m := v_table(st).table.COUNT;
    FOR j IN 1 .. st_m LOOP
    IF v_table(st).table(j).imp_column IS NULL THEN
    uk_table := v_table(st).table(j).column;
    pk_table := poisci_pk_tabele(ref_table);
    inner_st := v_table(st).table(j).ref_indeks; -- HERE IS ERROR (line 111)
    inner_table := vrni_podatke_r(v_table, ref_table, uk_table, inneri_st, st);
    END IF;
    END LOOP;
    Thx all for help.

    Hi !
    declare
      v_t t_typ := t_typ(); -- initialization t_typ is array(10) of number
    begin
      v_t.extend;  -- extends v_t only for 1 element ;
      v_t(2) := 0;
    end;this code produces an error "subscript beyond ... " because extnde is done only for one element
    declare
      v_t t_typ := t_typ(); -- initialization t_typ is array(10) of number
    begin
      v_t.extend(2);  -- extends v_t for 2 elements ;
      v_t(2) := 0;
    end;This code is OK
    T

  • Subscript beyond count error

    Hi I've tried the following code but getting the error subscript beyond count error
    create or replace procedure test(
                                       p_srrce               in   DIM_AD.DE%type,
                                       p_date         in   varchar2,
                                       p_asset_id       in   DISET.PE_ID%type,
                                      p_nt_id              in    FAT_T.DT_ID%type,
                                        chek_status                         out varchar2,
                                       logs_dat                        out varchar2
    IS
    TYPE da_list  IS  TABLE OF FAT_T.DT_ID%TYPE;
    TYPE pd_list  IS TABLE OF FAT_T.pd%TYPE;
    TYPE v_txt_list  IS TABLE OF FAT_T.v_txt%TYPE;
    TYPE ttime_list IS TABLE OF FAT_T.ttime%TYPE;
    type t_rowid IS TABLE OF rowid INDEX BY binary_INTEGER;
      v_d_srce             varchar2(222);
      v_prdat        date ;
    no_d_eep exception;
         v_da_list  da_list ;
         v_pd_list  pd_list ;
         v_v_txt_list  v_txt_list ;
         v_ttime_list  ttime_list ;
         v_rowid  t_rowid ;
    BEGIN
      v_d_srce             :=   trim(p_srrce);
      v_prdat       :=   to_date(trim(p_date),'mm/dd/yyyy');
        DBMS_OUTPUT.PUT_LINE ( 'value v_prdat '||v_prdat );   
    ------   After executing this procedure the output statemnt has come till here after the got the error subscript beyond count
      SELECT     
                     DT_ID,
                  pd,
                    v_txt,
                      ttime
                       fdp.ROWID
              bulk collect  into  v_da_list , v_pd_list ,v_v_txt_list , v_ttime_list,v_rowid            
                  FROM
                       FAT_T
                 WHERE   
                        pd = NVL(p_asset_id ,pd)
                       AND DT_ID = NVL(p_nt_id ,DT_ID)
                       AND pedt=v_prdat ;
      FOR i in    v_da_list.first .. v_da_list.last     LOOP
          DBMS_OUTPUT.PUT_LINE ( 'Values are '||v_da_list(i) );
      END LOOP ;  
         EXCEPTION
        END;
    Please help in this

    Hi,
    it's hard to reproduce without having your data at hand.
    Is it possible for you to reproduce the error with a table having few rows?
    Can you post CREATE TABLE and INSERT statement for FAT_T table?
    How many rows do you have in FAT_T table?
    The error 6533 literally has this explanation:
    The SUBSCRIPT_BEYOND_COUNT Exception (ORA-06533) occurs when a program references a nested table or varray element using an index number larger than the number of elements in the collection.
    So I can only think that it occurs if you are trying to use an index larger than your table.
    That's why I said your original code could have had a problem in the LOOP part in case the query was not returning any row.
    But actually in case the array was empty you would get another error in the loop (ORA-06502: PL/SQL: numeric or value error)
    I saw that your array type are all nested tables except t_rowid which is an associative array using BINARY_INTEGER as index.
    This index can be up to 2^32. So unless you have a very high number of rows (more than 2.15 billions) you should not get this error.
    I can suggest to check 2 things:
    How many rows does your SELECT statement returns?
    Comment the exception block to see exactly which line is throwing that error.
    Post some sample data to reproduce your problem
    Actually if I try to do something similar in my environment using EMP table I don't get any error (if my select returns rows):
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 7 12:22:28 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    SQL> DECLARE
      2     TYPE t_empno IS TABLE OF emp.empno%TYPE;
      3     TYPE t_ename IS TABLE OF emp.ename%TYPE;
      4     TYPE t_hiredate IS TABLE OF emp.hiredate%TYPE;
      5     TYPE t_sal IS TABLE OF emp.sal%TYPE;
      6     TYPE t_rowid IS TABLE OF ROWID
      7                        INDEX BY BINARY_INTEGER;
      8
      9     v_empno        t_empno;
    10     v_ename        t_ename;
    11     v_hiredate     t_hiredate;
    12     v_sal          t_sal;
    13     v_rowid        t_rowid;
    14
    15  BEGIN
    16     SELECT empno, ename, hiredate, sal
    17          , ROWID
    18       BULK COLLECT INTO v_empno, v_ename, v_hiredate, v_sal
    19          , v_rowid
    20       FROM emp;
    21
    22     FOR i IN v_empno.FIRST .. v_empno.LAST
    23     LOOP
    24        DBMS_OUTPUT.put_line ('Values are ' || v_empno (i));
    25     END LOOP;
    26  END;
    27  /
    Values are 7369
    Values are 7499
    Values are 7521
    Values are 7566
    Values are 7654
    Values are 7698
    Values are 7782
    Values are 7788
    Values are 7839
    Values are 7844
    Values are 7876
    Values are 7900
    Values are 7902
    Values are 7934
    PL/SQL procedure successfully completed.
    SQL>
    Regards.
    Alberto

  • Subscript beyond count error varray

    create or replace type t_var_type is varray(20) of varchar2(2000);
    create or replace procedure p_test(in_arr t_var_type) is
    v_send varchar2(2000);
    begin
    --in_arr := t_var_type();
    for i in 1..in_arr.count loop
    if in_arr(i) is not null then
    if v_send is null then
    v_send := in_arr(i);
    else
    v_send := v_send ||'|'|| in_arr(i);
    end if;
    end if;
    end loop;
    dbms_output.put_line('v_send: '||v_send);
    end;
    DECLARE
    v_t t_var_type;
    BEGIN
    v_t := t_var_type();
    dbms_output.put_line(v_t.count);
    -- v_t.EXTEND(2);
    dbms_output.put_line(v_t.count);
    v_t(1) := NULL;
    v_t(2) := 'A';
    dbms_output.put_line(v_t.count);
    v_t(3) := NULL;
    -- v_t(4) := 'C';
    -- v_t(5) := NULL;
    p_test(v_t);
    END;
    when i run the above block
    1. I get subscrip beyond count error
    question:
    where in the code should I extend the varray in the stored procedure to overcome this ?

    Hi,
    user650888 wrote:
    Thank you, stand alone procedure works, but if I just add two more input parameters and package it, While testing the procedure, I declare another varray
    and calling it. I get invalid argument call to procedure error
    create table table4(col1 varchar2(100), col2 varchar2(100));
    create or replace package mytest
    is
    TYPE t_var1_type IS VARRAY(20) OF varchar2(2000);
    procedure p_test(col1 in table4.col1%type, col2 in table4.col2%type, in_arr in t_var1_type);
    end mytest;
    / ...You may have noticed that this site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    Now to test the above p_test, I am using the below. Note I am declaring new varray to test it, Is that the issue ? When I call the packaged procedure, I get
    invalid argument error
    DECLARE
    TYPE t_eg_type IS VARRAY(20) OF varchar2(2000);
    v_t t_eg_type;
    BEGIN
    v_t := t_eg_type(NULL,'A',NULL,'B','C',NULL,NULL,NULL,'C',NULL,NULL,NULL);
    mytest.p_test('a', 'b', v_t);
    END;
    /You have declared two separate datatypes:
    (1) mytest.t_var1_type (that is, a type called t_var1_type, defined within the package mytest) and
    (2) t_eg_type
    These are 2 distinct datatypes.  You can't use one in places where the other is expected.  It doesn't matter how similar the definitions of the 2 datatypes are, they remain 2 separate datatypes. 
    The procedure mytest.p_test is expecting 3 arguments, the 3rd of which must be a mytest.t_var1_type.  No other data type will work, no matter what it's definition.  That argument must be a mytest.t_var1_type, or else you'll get the error "PLS-00306: wrong number or *types* of arguments ..." when you compile the call.
    Since mytest.t_var1_type is exposed in the package spec, anyone who can use the package can use that data type.  So to use the package, you might write an anonymous blokc like this:DECLARE
    v_t mytest.t_var1_type;
    BEGIN
    v_t := mytest.t_var1_type (NULL, 'A', NULL, 'B', 'C', NULL, NULL, NULL, 'C', NULL, NULL, NULL);
    mytest.p_test ('a', 'b', v_t);
    END;

  • ORA-06533 during sdo_geor.Mosaic in 11g

    I'm trying to mosaic four rasters together. I'm using this call:
    sdo_geor.mosaic('MOSAICSOURCE', 'GEORASTER', geor, NULL);
    The 4 source rasters are georeferenced, rectified, have the same spatial resolutions and number of bands, and are valid:
    SQL> select sdo_geor.getSpatialResolutions(georaster),sdo_geor.getModelSRID(georaster),sdo_geor.isRectified(georaster),sdo_geor.getB
    andDimSize(georaster),sdo_geor.validateGeoRaster(georaster) from MOSAICSOURCE;
    SDO_GEOR.GETSPATIALRESOLUTIONS(GEORASTER)
    SDO_GEOR.GETMODELSRID(GEORASTER)
    SDO_GEOR.ISRECTIFIED(GEORASTER)
    SDO_GEOR.GETBANDDIMSIZE(GEORASTER)
    SDO_GEOR.VALIDATEGEORASTER(GEORASTER)
    SDO_NUMBER_ARRAY(.000833333, .000833333)
    8192
    TRUE
    1
    TRUE
    SDO_NUMBER_ARRAY(.000833333, .000833333)
    8192
    TRUE
    1
    TRUE
    SDO_NUMBER_ARRAY(.000833333, .000833333)
    8192
    TRUE
    1
    TRUE
    SDO_NUMBER_ARRAY(.000833333, .000833333)
    8192
    TRUE
    1
    TRUE
    When displayed in PCI's FreeView app the 4 georasters abutt each other in a square.
    The exact error is:
    13:30:45 [SELECT - 0 row(s), 0.000 secs] [Error Code: 6533, SQL State: 65000] ORA-06533: Subscript beyond count
    ORA-06512: at "MDSYS.SDO_GEOR_INT", line 1082
    ORA-06512: at "MDSYS.SDO_GEOR_INT", line 1440
    ORA-06512: at "MDSYS.SDO_GEOR", line 1105
    ORA-06512: at "GRIM.MOSAIC", line 32 (this is my line of code, above)
    I'm using "Oracle Database 11g Release 11.1.0.0.0 - Production".
    The metadata for one of the rasters is (the others are similar):
    GEORASTER(RASTERTYPE, SPATIALEXTENT(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO
    SDO_GEORASTER(20001, SDO_GEOMETRY(2003, 8192, NULL, SDO_ELEM_INFO_ARRAY(1, 1003,
    1), SDO_ORDINATE_ARRAY(-104.00042, 40.0004167, -104.00042, 38.9995833, -102.999
    58, 38.9995833, -102.99958, 40.0004167, -104.00042, 40.0004167)), 'MOSAICSOURCE_
    RDT', 118, XMLTYPE(<georasterMetadata xmlns="http://xmlns.oracle.com/spatial/geo
    raster">
    <objectInfo>
    <rasterType>20001</rasterType>
    <isBlank>false</isBlank>
    <defaultRed>1</defaultRed>
    <defaultGreen>1</defaultGreen>
    <defaultBlue>1</defaultBlue>
    </objectInfo>
    <rasterInfo>
    <cellRepresentation>UNDEFINED</cellRepresentation>
    <cellDepth>16BIT_S</cellDepth>
    <NODATA>-32767</NODATA>
    <totalDimensions>2</totalDimensions>
    <dimensionSize type="ROW">
    <size>1201</size>
    </dimensionSize>
    <dimensionSize type="COLUMN">
    <size>1201</size>
    </dimensionSize>
    <ULTCoordinate>
    <row>0</row>
    <column>0</column>
    </ULTCoordinate>
    <blocking>
    <type>NONE</type>
    <totalRowBlocks>1</totalRowBlocks>
    <totalColumnBlocks>1</totalColumnBlocks>
    <rowBlockSize>1201</rowBlockSize>
    <columnBlockSize>1201</columnBlockSize>
    </blocking>
    <interleaving>BIL</interleaving>
    <pyramid>
    <type>NONE</type>
    </pyramid>
    <compression>
    <type>NONE</type>
    </compression>
    </rasterInfo>
    <spatialReferenceInfo>
    <isReferenced>true</isReferenced>
    <isRectified>true</isRectified>
    <SRID>8192</SRID>
    <spatialResolution dimensionType="X">
    <resolution>0.000833333333333333</resolution>
    </spatialResolution>
    <spatialResolution dimensionType="Y">
    <resolution>0.000833333333333333</resolution>
    </spatialResolution>
    <modelCoordinateLocation>UPPERLEFT</modelCoordinateLocation>
    <modelType>FunctionalFitting</modelType>
    <polynomialModel rowOff="0" columnOff="0" xOff="0" yOff="0" zOff="0" rowScal
    e="1" columnScale="1" xScale="1" yScale="1" zScale="1">
    <pPolynomial pType="1" nVars="2" order="1" nCoefficients="3">
    <polynomialCoefficients>48000.50000000007 0 -1200.000000000001</polynomi
    alCoefficients>
    </pPolynomial>
    <qPolynomial pType="1" nVars="0" order="0" nCoefficients="1">
    <polynomialCoefficients>1</polynomialCoefficients>
    </qPolynomial>
    <rPolynomial pType="1" nVars="2" order="1" nCoefficients="3">
    <polynomialCoefficients>124800.5000000004 1200.000000000001 0</polynomia
    lCoefficients>
    </rPolynomial>
    <sPolynomial pType="1" nVars="0" order="0" nCoefficients="1">
    <polynomialCoefficients>1</polynomialCoefficients>
    </sPolynomial>
    </polynomialModel>
    </spatialReferenceInfo>
    <layerInfo>
    <layerDimension>BAND</layerDimension>
    <subLayer>
    <layerNumber>1</layerNumber>
    <layerDimensionOrdinate>0</layerDimensionOrdinate>
    <layerID>Not Specified</layerID>
    </subLayer>
    </layerInfo>
    </georasterMetadata>
    Any suggestions of where to go from here?
    Thanks!
    -Bruce Bockius

    You're correct, it is 11.1.0.6.0 as shown in the Oracle Installed Products. For some reason my favorite client displays a different version.
    -Bruce

  • Error ORA-06533:  executing dbms_odm.CreateStdFactmv

    Hi,
    I have been defined and validated a metamodel for a cube and their dimensions, using CWM2 package. I obtained the scripts for dimension materialized view with dbms_odm.CreateDimmv_gs, I run them successfully, but when I try to run dbms_odm.CreateStdFactmv to generate fact table materialized view I get:
    ORA-06533: Subscript beyond count
    ORA-06512: at "OLAPSYS.DBMS_ODM", line 4771
    ORA-06512: at line 2
    and I'm running Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit
    Can someone help me???

    Hi,
    No body have answered me, but I found the solution, if somebody has the same problem, check the value of parameter dimkeymap before to execute
    cwm2_olap_table_map.map_facttbl_levelkey and cwm2_olap_table_map.map_facttbl_measure
    dimkeymap is a string enclose in single quotes like as follows
    'DIM:dim1_name/HIER:hier_name/LVL:level_name/COL:map_column;DIM:.......'
    You must to be carefull to write the lowest level name for each hierarchy.

  • Why? : ORA-06532: Subscript outside of limit

    I want to read a number of rows into an array of records.
    I keep getting this error (any ideas?):
    ERROR at line 1:
    ORA-06532: Subscript outside of limit
    here is the procedure:
    CURSOR get_all_locations (type IN VARCHAR2) IS
    SELECT
    FROM group
    WHERE type = type;
    PROCEDURE fetchAllServerLocations IS
    i BINARY_INTEGER := 0;
    erec egroup%ROWTYPE;
    BEGIN
    dbms_output.enable;
    dbms_output.put_line('BEGIN: fetchAllServerLocations()');
    FOR erec IN get_all_locations('s')
    LOOP
    -- dbms_output.put_line('i=[' || i || ']');
    dbms_output.put_line('server location: [' || erec.group_id || erec.name || ']');
    allServerLocations(i) := erec;
    i := i + 1;
    END LOOP;
    dbms_output.put_line('END: fetchAllServerLocations()');
    END fetchAllServerLocations;
    ---

    You have a (poor) solution in search of a problem.
    PL/SQL will never be faster than plain SQL to access data within Oracle DB.You do not know what the problem is and you do not know the solution.
    The only thing you know is a syntax error that I am having with a very small piece of code that is trying to do a very specific thing.
    You have tried to reach too far and are blinded by trying to solve a big problem when there is really a small problem to solve.
    <ranton>
    I (we) have a well thought out solution and algorithm that will solve our problem. I am attempting to implement the solution that has already been analyzed over several weeks now by someone that has 10+ years of knowledge of what data we need to move around and where. The problem is unknown to you. The solution is unknown to you, yet you are making statements about both.
    I cannot write procedures, functions and have them called in the order that I need with plain SQL. Also after the implementation is complete in PL/SQL it will be fast enough for what we need to do. The requirement I have is not to have the one time script run as blazingly fast as it possibly can at all costs to providing an implementation. If I were to spend ten weeks writing this in assembly, it would be much faster than SQL but "faster" is not always better nor what is wanted here.
    This plane:
    http://en.wikipedia.org/wiki/Concorde
    is faster than this plane
    http://en.wikipedia.org/wiki/Concorde
    and is far superior in many, many ways, but there is a reason you have never flown one and a reason all airports everywhere do not have them coming and going every minute AND a big reason they were grounded to never fly again. I am not sure why I have to have this same discussion every now and then when someone comes to me and says "this would be faster".
    Right now in another area I am having an unbelievable battle: Do we write our own messaging system that would be much faster than JMS, AMQP or anything we could simply pull off the shelf - I mean it will be faster but only cost $200K in its first year of writing and maintenance.
    Please go home with comments like this and if you are not going to help contribute to the solution do not log on cheez.
    "Fast" is not a requirement nor is it a concern with this problem and solution. It is completely beside the point.
    </rantoff>

Maybe you are looking for

  • Black monitor computer not responding

    My computer will not turn on it bings like it is but the monitor stays black and the mouse or track pad also do not work but for a second. I checked the cord and it is ok and I replaced batteries in track pad and mouse and still nothing

  • How to control IDOC processing in XI

    hi I have scenario where File --> XI --> IDOC Source structure Header           1...1     Detail         0..unbounded Trailer             1..1 For every detail i need to generate 1 doc My requirement is that i dont want to send all the IDOCs at one s

  • SAP Lumira Desktop - Lumira Server problem

    Hi everyone, Since a couple of days I try to publish some reports from SAP Lumira Desktop on SAP Lumira Server. Both versions are 1.15 and SAP HANA version is rev70. I installed Lumira Server as mentioned in installation guide. Imported package, crea

  • Object Expected Errors in IE 6/ 7

    www.crystalhoyt.com Error messages on every page relative to the navigation bar. Says that an object is expected, char 1. I can't figure out what is "missing" because I made the navigation bar with the Dreamweaver Menu Tool. Please advise.

  • SOAP to IDOC scenario

    Hello All, I have a scenario where the sender system is outside our landscape and I need to post the PO data to SAP system using XI. I know its a SOAP to IDOC scenario but I am not given a wsdl but am given only a xsd and one XML as input. Can I use