Ora-06531 reference to uninitialized collection --- Please help

Hello,
I am getting this "ora-06531 reference to uninitialized collection" while executing the below procedure.
=======================
PROCEDURE iud_account_col
( pv_account_version IN account_version_t
AS
LC_USR_ID CONSTANT VARCHAR2(30) := pkg_util.get_usr_id ;
LC_TMSTMP CONSTANT TIMESTAMP /*WITH TIME ZONE*/ := pkg_util.get_tmstmp ;
lv_level VARCHAR2(100);
lv_am_key_id number;
lv_acct_cusip VARCHAR2(12);
LC_AM_KEY_ID number;
LC_AM_VER_NUM number;
BEGIN
DECLARE
lv_am account_version_t;
lv_amv account_maint_t;
lv_amvv account_maint_version_t;
cursor c_acct_cusip ( cv_am_key_id varchar2) is
select acct_cusip
from account_maintenance
where am_key_id = lv_amv.am_key_id;
BEGIN
lv_am := pv_account_version;
lv_level := 'ACCOUNT_MAINT' ;
lv_amv := pv_account_version.account_maint;
LC_AM_KEY_ID := lv_amv.am_key_id;
FOR acct_cusip_info in c_acct_cusip (lv_am_key_id)
LOOP
lv_acct_cusip := acct_cusip_info.acct_cusip;
END LOOP;
IF lv_amv.action = 'I'
THEN
INSERT
INTO
account_maintenance
( am_key_id
, acct_cusip
, am_orig_cre_tmstp
, am_orig_usr_id
, delete_ind
, add_usr_id
, add_tmstmp
, lock_level_num
VALUES
( lv_amv.am_key_id
, lv_amv.acct_cusip
, LC_TMSTMP
, LC_USR_ID
, lv_amv.delete_ind
, LC_USR_ID
, LC_TMSTMP
, lv_amv.lock_level_num
END IF;
lv_amvv := pv_account_version.account_maint.account_maint_version;
lv_level := 'ACCOUNT_MAINT_VERSION';
LC_AM_VER_NUM := lv_amvv.am_ver_num;
IF lv_amvv.action = 'I'
THEN
-- Insert issue maint version
INSERT
INTO
ACCOUNT_MAINTENANCE_VERSION
( AM_KEY_ID
, AM_VER_NUM
, ACCT_CUSIP
, LEGAL_ENTITY
, APPR_STATUS_REF_ID
, INACTIVE_IND
, ADD_USR_ID
, ADD_TMSTMP
, UPD_USR_ID
, UPD_TMSTMP
, LOCK_LEVEL_NUM
VALUES
( lv_amv.am_key_id
, lv_amvv.am_ver_num
, lv_acct_cusip
, lv_amvv.legal_entity
, lv_amvv.appr_status_ref_id
, 'N'
, LC_USR_ID
, LC_TMSTMP
, LC_USR_ID
, LC_TMSTMP
, lv_amvv.lock_level_num
END IF; --- end for account maint version.
FOR j IN lv_amv.account_maint_comment_col.FIRST
.. lv_amv.account_maint_comment_col.LAST
LOOP
DECLARE
lv_amvc account_maint_comment_t;
BEGIN
lv_amvc := lv_amv.account_maint_comment_col(j);
lv_level := 'ACCOUNT_MAINT_COMMENT';
IF lv_amvc.action = 'I'
THEN
--- Insert into account maintenance comment table
INSERT
INTO
ACCOUNT_MAINTENANCE_COMMENT
( AM_KEY_ID
, AM_VER_NUM
, COMMENT_NUM
, COMMENT_TMSTP
, COMMENT_TXT
, INACTIVE_IND
, ADD_USR_ID
, ADD_TMSTMP
, LOCK_LEVEL_NUM
VALUES
( LC_AM_KEY_ID
, LC_AM_VER_NUM
, lv_amvc.comment_num
, LC_TMSTMP
, lv_amvc.comment_txt
, 'N'
, LC_USR_ID
, LC_TMSTMP
, lv_amvc.lock_level_num
END IF;
END;
END LOOP; --- end loop for account maint comments
END;
COMMIT WORK;
RETURN;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK WORK;
RAISE;
END iud_account_col;
====================
The UDT's are below:
CREATE OR REPLACE TYPE ACCOUNT_VERSION_T
AS OBJECT
     PORTFOLIO     PORTFOLIO_T
,     ACCOUNT_MAINT          ACCOUNT_MAINT_T
CREATE OR REPLACE TYPE ACCOUNT_MAINT_T
AS OBJECT
( AM_KEY_ID number
, ACCT_CUSIP     varchar2(12)
, DELETE_IND varchar2(1)
, ADD_USR_ID varchar2(20)
, ADD_TMSTMP timestamp
, UPD_USR_ID varchar2(20)
, UPD_TMSTMP timestamp
, LOCK_LEVEL_NUM number
, ACTION VARCHAR2(1)
, ACCOUNT_MAINT_VERSION ACCOUNT_MAINT_VERSION_T
, ACCOUNT_MAINT_COMMENT_COL ACCOUNT_MAINT_COMMENT_COL_T
CREATE OR REPLACE TYPE ACCOUNT_MAINT_VERSION_T
AS OBJECT
( AM_KEY_ID number
, AM_VER_NUM number
, ACCT_CUSIP     varchar2(12)
, LEGAL_ENTITY varchar2(100)
, APPR_STATUS_REF_ID number
, FUND_INACTIVE_TMSTMP timestamp
, ADD_USR_ID varchar2(20)
, ADD_TMSTMP timestamp
, UPD_USR_ID varchar2(20)
, UPD_TMSTMP timestamp
, LOCK_LEVEL_NUM number
, ACTION VARCHAR2(1)
CREATE OR REPLACE TYPE ACCOUNT_MAINT_COMMENT_T
AS OBJECT
( AM_KEY_ID number
, AM_VER_NUM number
, COMMENT_NUM     number
, COMMENT_TXT varchar2(400)
, ADD_USR_ID varchar2(20)
, ADD_TMSTMP timestamp
, UPD_USR_ID varchar2(20)
, UPD_TMSTMP timestamp
, LOCK_LEVEL_NUM number
, ACTION VARCHAR2(1)
=====================================================
This is how I am trying to execute:
Declare
pv_account_version account_version_t := account_version_t(null
, account_maint_t ( 10041
, '11111111'
, 'N'
,'abc'
, NULL
, NULL
, NULL
, 1
,NULL-- 'I'
,ACCOUNT_MAINT_VERSION_T(10031
, 10001
, NULL
,'Legal entity'
,22
,NULL
,'abc'
,NULL
, NULL
,NULL
, 1
,NULL --'I'
,ACCOUNT_MAINT_COMMENT_COL_T(
10031
,10001
,1001
,'My first comment'
,'abc'
, NULL
, NULL
, NULL
, 1
, 'I')
Begin
pkg_cdm_process_v2.iud_account(pv_account_version);
END;
What am I doing wrong here....
Please help.
Thanks.

Now if we only knew where the error was flagged.
PROCEDURE Iud_account_col
     (pv_account_version  IN ACCOUNT_VERSION_T)
AS
  lc_usr_id      CONSTANT VARCHAR2(30) := pkg_util.get_usr_id;
  lc_tmstmp      CONSTANT TIMESTAMP /*WITH TIME ZONE*/ := pkg_util.get_tmstmp;
  lv_level       VARCHAR2(100);
  lv_am_key_id   NUMBER;
  lv_acct_cusip  VARCHAR2(12);
  lc_am_key_id   NUMBER;
  lc_am_ver_num  NUMBER;
BEGIN
  DECLARE
    lv_am    ACCOUNT_VERSION_T;
     lv_amv   ACCOUNT_MAINT_T;
     lv_amvv  ACCOUNT_MAINT_VERSION_T;
     CURSOR c_acct_cusip(cv_am_key_id VARCHAR2) IS
       SELECT acct_cusip
       FROM   account_maintenance
       WHERE  am_key_id = lv_amv.am_key_id;
  BEGIN
    lv_am := pv_account_version;
    lv_level := 'ACCOUNT_MAINT';
    lv_amv := pv_account_version.account_maint;
    lc_am_key_id := lv_amv.am_key_id;
    FOR acct_cusip_info IN c_acct_cusip(lv_am_key_id) LOOP
      lv_acct_cusip := acct_cusip_info.acct_cusip;
    END LOOP;
    IF lv_amv.ACTION = 'I' THEN
      INSERT INTO account_maintenance
                 (am_key_id,
                  acct_cusip,
                  am_orig_cre_tmstp,
                  am_orig_usr_id,
                  delete_ind,
                  add_usr_id,
                  add_tmstmp,
                  lock_level_num)
      VALUES     (lv_amv.am_key_id,
                  lv_amv.acct_cusip,
                  lc_tmstmp,
                  lc_usr_id,
                  lv_amv.delete_ind,
                  lc_usr_id,
                  lc_tmstmp,
                  lv_amv.lock_level_num);
    END IF;
    lv_amvv := pv_account_version.account_maint.account_maint_version;
    lv_level := 'ACCOUNT_MAINT_VERSION';
    lc_am_ver_num := lv_amvv.am_ver_num;
    IF lv_amvv.ACTION = 'I' THEN
      -- Insert issue maint version
      INSERT INTO account_maintenance_version
                 (am_key_id,
                  am_ver_num,
                  acct_cusip,
                  legal_entity,
                  appr_status_ref_id,
                  inactive_ind,
                  add_usr_id,
                  add_tmstmp,
                  upd_usr_id,
                  upd_tmstmp,
                  lock_level_num)
      VALUES     (lv_amv.am_key_id,
                  lv_amvv.am_ver_num,
                  lv_acct_cusip,
                  lv_amvv.legal_entity,
                  lv_amvv.appr_status_ref_id,
                  'N',
                  lc_usr_id,
                  lc_tmstmp,
                  lc_usr_id,
                  lc_tmstmp,
                  lv_amvv.lock_level_num);
    END IF; --- end for account maint version.
    FOR j IN lv_amv.account_maint_comment_col.FIRST.. lv_amv.account_maint_comment_col.LAST LOOP
      DECLARE
        lv_amvc  ACCOUNT_MAINT_COMMENT_T;
      BEGIN
        lv_amvc := lv_amv.Account_maint_comment_col(j);
        lv_level := 'ACCOUNT_MAINT_COMMENT';
        IF lv_amvc.ACTION = 'I' THEN
          --- Insert into account maintenance comment table
          INSERT INTO account_maintenance_comment
                     (am_key_id,
                      am_ver_num,
                      comment_num,
                      comment_tmstp,
                      comment_txt,
                      inactive_ind,
                      add_usr_id,
                      add_tmstmp,
                      lock_level_num)
          VALUES     (lc_am_key_id,
                      lc_am_ver_num,
                      lv_amvc.comment_num,
                      lc_tmstmp,
                      lv_amvc.comment_txt,
                      'N',
                      lc_usr_id,
                      lc_tmstmp,
                      lv_amvc.lock_level_num);
        END IF;
      END;
    END LOOP; --- end loop for account maint comments
  END;
  COMMIT WORK;
  RETURN;
EXCEPTION
  WHEN OTHERS THEN
    ROLLBACK WORK;
    RAISE;
END iud_account_col;

Similar Messages

  • ORA-06531 reference to uninitialized collection in oracle 6i form

    Hello,
    I am importing data from excel to database table with column mapping (oracle 6i forms)using ole2 package, then calling package
    which is having a procedure. while executing the package procedure,
    I am getting error 'ora-06531 reference to uninitialized collection' i.e. before for i in 1..in_lData.count
    I am working on it but still not getting any solution. There is no problem in coding my form gets compiled but at run time i am getting this error.
    And while debugging, data fetched from ole2 package is not passed to for loop of the procedure.
    (first of all i am calling ole 2 package, then from ole2 package i am calling my package. procedure)
    please help me. My code is this
    ------------------------------------------------------Ole 2 Package begins-----------------------------------------------------------------
    PROCEDURE get_excel IS
    APPLICATION OLE2.OBJ_TYPE;
         WORKBOOKS OLE2.OBJ_TYPE;
         WORKBOOK OLE2.OBJ_TYPE;
         WORKSHEETS OLE2.OBJ_TYPE;
         WORKSHEET OLE2.OBJ_TYPE;
         CELL OLE2.OBJ_TYPE;
         CTR NUMBER(12);
         COLS NUMBER(2);
         CELLVALUE VARCHAR2(89);
         C_ROUTE VARCHAR2(255);
         V_ROUTE VARCHAR2(1000);
         C_TRNDATE VARCHAR2(255);
         V_TRNDATE VARCHAR2(1000);
         C_TTIME     VARCHAR2(255);
         V_TTIME VARCHAR2(1000);
         C_TID VARCHAR2(255);
         V_TID VARCHAR2(1000);
         FILENAME VARCHAR2(500);
         v_path                     varchar2(1000):=:path;
         ARGS OLE2.OBJ_TYPE;
         tDataList     PK_EXCEL_TO_DB.tDataList;
    BEGIN
                   :progress:='Please wait...';
                   SYNCHRONIZE;
                   --------------INITIATE EXCEL APPLICATION---------------------------
                   filename := V_PATH;--GET_FILE_NAME('c:\', File_Filter=>'Excel Files (*.xls)|*.xls|'); -- to pick the file
                   APPLICATION := OLE2.CREATE_OBJ('EXCEL.APPLICATION');
                   OLE2.SET_PROPERTY(APPLICATION,'VISIBLE','FALSE');
                   ----------------GET WORKBOOKS FROM EXCEL APPLICATION---------------
                   WORKBOOKS := OLE2.GET_OBJ_PROPERTY(APPLICATION, 'WORKBOOKS');
                   ----------------OPEN REQUIRED WORKBOOK-----------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS, FILENAME);
                   WORKBOOK := OLE2.GET_OBJ_PROPERTY(WORKBOOKS,'OPEN',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ----------------OPEN REQUIRED WORKSHEET---------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,'Sheet1');
                   WORKSHEET := OLE2.GET_OBJ_PROPERTY (WORKBOOK,'WORKSHEETS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ----------------GET CELL VALUE-------------------------------------
                   ctr := 2; --row number
                   cols := 1; -- column number
                   FIRST_RECORD;
                   LOOP
                   -----------------------COLUMN1-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS); --COLS
                   OLE2.ADD_ARG(ARGS,1);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_ROUTE := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
              ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,1);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_ROUTE := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   -----------------------COLUMN2-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS);
                   OLE2.ADD_ARG(ARGS,2);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_TRNDATE:= OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,2);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_TRNDATE:= OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   -----------------------COLUMN3-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS);
                   OLE2.ADD_ARG(ARGS,3);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_TTIME := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,3);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_TTIME := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   -----------------------COLUMN4-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS);
                   OLE2.ADD_ARG(ARGS,4);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_TID := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,4);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_TID := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
    PK_EXCEL_TO_DB.PR_DO_INSERT(tDataList);                          
    EXIT WHEN length(V_Route) = 0 or length(V_Route) is null;
    ctr := ctr + 1;
              cols := 1;
    i_ldata := PK_EXCEL_TO_DB.tDatalist(); --already define                    
    PK_EXCEL_TO_DB.PR_DO_INSERT(tDataList);
    END LOOP;
    :progress:='EXCEL READING IS DONE...';
    ----------------CLOSE THE EXCEL SHEET AFTER READING--------------
    OLE2.INVOKE(APPLICATION,'QUIT');
    -----------------RELEASE ALL OBJECTS
    OLE2.RELEASE_OBJ(CELL);
    OLE2.RELEASE_OBJ(WORKSHEET);
    OLE2.RELEASE_OBJ(WORKBOOK);
    OLE2.RELEASE_OBJ(WORKBOOKS);
    OLE2.RELEASE_OBJ(APPLICATION);
    :PROGRESS := 'DATA INSERTED INTO THE TABLE '; SYNCHRONIZE;
    SYNCHRONIZE;
    exception
    WHEN OTHERS THEN
    MESSAGE(sqlerrm);
    END;
    ----------------------------------------------------------------------------------------OLE2 PACKAGE ENDS-------------------------------------------------
    ------------------------------------------------------------PK_EXCEL_TO_DB PACKAGE SPECIFICATION---------------------------------------------
    PACKAGE PK_EXCEL_TO_DB IS
    TYPE tKeyValue IS RECORD (
    CROUTE VARCHAR2(255),
    VROUTE VARCHAR2(1000),
    CTRNDATE VARCHAR2(255),
    VTRNDATE VARCHAR2(1000),
    CTTIME     VARCHAR2(255),
    VTTIME VARCHAR2(1000),
    CTID VARCHAR2(255),
    VTID VARCHAR2(1000));
    TYPE tDataList IS TABLE OF tKeyValue;
    PROCEDURE PR_DO_INSERT(i_lData IN tDataList);     
    END;
    -----------------------------------------------------------------PK_EXCEL_TO_DB PACKAGE BODY-----------------------------------------------------
    PACKAGE BODY PK_EXCEL_TO_DB IS
    PROCEDURE PR_DO_INSERT(i_lData IN tDataList) IS
    CC_ROUTE VARCHAR2(255);
    VV_ROUTE VARCHAR2(1000);
    CC_TRNDATE VARCHAR2(255);
    VV_TRNDATE VARCHAR2(1000);
    CC_TTIME     VARCHAR2(255);
    VV_TTIME VARCHAR2(1000);
    CC_TID VARCHAR2(255);
    VV_TID VARCHAR2(1000);
    BEGIN
    FOR i IN 1..i_lData.count
    LOOP
    CC_ROUTE:=CC_ROUTE || ',' || i_ldata(i).CROUTE;
    VV_ROUTE:=VV_ROUTE|| ',''' || i_ldata(i).VROUTE || '''';
    CC_TRNDATE :=CC_TRNDATE || ',' || i_ldata(i).CTRNDATE ;
    VV_TRNDATE :=VV_TRNDATE || ',''' || i_ldata(i).VTRNDATE || '''';
    CC_TTIME :=CC_TTIME || ',' || i_ldata(i).CTTIME ;
    VV_TTIME :=VV_TTIME || ',''' || i_ldata(i).VTTIME || '''';
    CC_TID :=CC_TID || ',' || i_ldata(i).CTID ;
    VV_TID :=VV_TID || ',''' || i_ldata(i).VTID|| '''';
    END LOOP;
    --EXECUTE IMMEDIATE
    FORMS_DDL('INSERT INTO TEMP2 (' || SUBSTR(CC_ROUTE, 2) || ' ' ||
                                                      SUBSTR(CC_TRNDATE, 2) || ' ' ||
                                                      SUBSTR(CC_TTIME, 2) || '' ||
                                                      SUBSTR(CC_TID, 2) || ')
    VALUES (' || SUBSTR(VV_ROUTE,2) || ' ' ||
                                       SUBSTR(VV_TRNDATE,2) || '' ||
                                       SUBSTR(VV_TTIME,2) || ' ' ||
                                       SUBSTR(VV_TID,2)|| ')');
    commit;
    END;
    END;
    ------------------------------------------------------------------------PK_EXCEL_TO_DB PACKAGE BODY ENDS--------------------------------------
    Thank You
    Sameer.

    Hii Andreas Weiden,
    Sorry for replying late. I am very thankful to Francois and your for your suggestion. I've gone through the documentation of collection and finally i got the solution.
    But I am unable to insert rercord to the table. Values are passed to the procedure, i am able to see the values while debugging and i get the message
    'DATA INSERTED INTO THE TABLE' but when i check it with sql, the table is empty. I've tried commit and standard.commit, but it doesn't works. My modified code is given below.
    PROCEDURE get_excel IS
    APPLICATION OLE2.OBJ_TYPE;
         WORKBOOKS OLE2.OBJ_TYPE;
         WORKBOOK OLE2.OBJ_TYPE;
         WORKSHEETS OLE2.OBJ_TYPE;
         WORKSHEET OLE2.OBJ_TYPE;
         CELL OLE2.OBJ_TYPE;
         CTR NUMBER(12);
         COLS NUMBER(2);
         CELLVALUE VARCHAR2(89);
         C_ROUTE   VARCHAR2(255);
         V_ROUTE   VARCHAR2(1000);
         C_TRNDATE VARCHAR2(255);
         V_TRNDATE VARCHAR2(1000);
         C_TTIME       VARCHAR2(255);
         V_TTIME   VARCHAR2(1000);
         C_TID     VARCHAR2(255);
         V_TID     VARCHAR2(1000);
         FILENAME   VARCHAR2(500);
         v_path                        varchar2(1000):=:path;
         ARGS OLE2.OBJ_TYPE;
         i_ldata PK_EXCEL_TO_DB.tDataList:=PK_EXCEL_TO_DB.tDataList();
         tDataList     PK_EXCEL_TO_DB.tDataList;
    BEGIN
                   :progress:='Please wait...';
                   SYNCHRONIZE;
                   --------------INITIATE EXCEL APPLICATION---------------------------
                   filename := V_PATH;--GET_FILE_NAME('c:\', File_Filter=>'Excel Files (*.xls)|*.xls|'); -- to pick the file
                   APPLICATION := OLE2.CREATE_OBJ('EXCEL.APPLICATION');
                   OLE2.SET_PROPERTY(APPLICATION,'VISIBLE','FALSE');
                   ----------------GET WORKBOOKS FROM EXCEL APPLICATION---------------
                   WORKBOOKS := OLE2.GET_OBJ_PROPERTY(APPLICATION, 'WORKBOOKS');
                   ----------------OPEN REQUIRED WORKBOOK-----------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS, FILENAME);
                   WORKBOOK := OLE2.GET_OBJ_PROPERTY(WORKBOOKS,'OPEN',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ----------------OPEN REQUIRED WORKSHEET---------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,'Sheet1');
                   WORKSHEET := OLE2.GET_OBJ_PROPERTY (WORKBOOK,'WORKSHEETS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ----------------GET CELL VALUE-------------------------------------
                   ctr := 2; --row number
                   cols := 1; -- column number               
                        FIRST_RECORD;
                   LOOP
                        i_ldata.extend(ctr);
                        i_ldata.extend(cols);
                        --tDataList:=PK_EXCEL_TO_DB.tDataList();
                   -----------------------COLUMN1-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS); --COLS
                   OLE2.ADD_ARG(ARGS,1);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_ROUTE := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(cols).CROUTE:=C_ROUTE;           
                ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,1);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_ROUTE := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(ctr).VROUTE:=V_ROUTE;
                   -----------------------COLUMN2-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS);
                   OLE2.ADD_ARG(ARGS,2);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_TRNDATE:= OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(cols).CTRNDATE:=C_TRNDATE;
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,2);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_TRNDATE:= OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(ctr).vtrndate:=v_trndate;
                   -----------------------COLUMN3-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS);
                   OLE2.ADD_ARG(ARGS,3);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_TTIME := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(cols).CTTIME:=C_TTIME;
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,3);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_TTIME := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(ctr).vttime:=v_ttime;
                   -----------------------COLUMN4-------------------------------------
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,COLS);
                   OLE2.ADD_ARG(ARGS,4);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   C_TID := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(cols).CTID:=C_TID;
                   ARGS := OLE2.CREATE_ARGLIST;
                   OLE2.ADD_ARG(ARGS,CTR);
                   OLE2.ADD_ARG(ARGS,4);
                   CELL := OLE2.GET_OBJ_PROPERTY(WORKSHEET,'CELLS',ARGS);
                   OLE2.DESTROY_ARGLIST(ARGS);
                   ARGS := OLE2.CREATE_ARGLIST;
                   V_TID := OLE2.GET_CHAR_PROPERTY(CELL,'TEXT');
                   i_ldata(ctr).vtid:=v_tid;
         PK_EXCEL_TO_DB.PR_DO_INSERT(i_ldata);               
    --     i_ldata := PK_EXCEL_TO_DB.tDatalist();
    EXIT WHEN length(V_Route) = 0 or length(V_Route) is null;
    ctr := ctr + 1;
    cols := 1;
    END LOOP;
    :progress:='EXCEL READING IS DONE...';
    ----------------CLOSE THE EXCEL SHEET AFTER READING--------------
    OLE2.INVOKE(APPLICATION,'QUIT');
    -----------------RELEASE ALL OBJECTS
    OLE2.RELEASE_OBJ(CELL);
    OLE2.RELEASE_OBJ(WORKSHEET);
    OLE2.RELEASE_OBJ(WORKBOOK);
    OLE2.RELEASE_OBJ(WORKBOOKS);
    OLE2.RELEASE_OBJ(APPLICATION);
    :PROGRESS := 'DATA INSERTED INTO THE TABLE '; SYNCHRONIZE;
    SYNCHRONIZE;
    exception 
    WHEN OTHERS THEN
    MESSAGE(sqlerrm);
    END;Package specification and package body is
    PACKAGE PK_EXCEL_TO_DB IS
                 TYPE tKeyValue IS RECORD (
                             CROUTE VARCHAR2(255),
                             VROUTE VARCHAR2(1000),
                             CTRNDATE VARCHAR2(255),
                             VTRNDATE VARCHAR2(1000),
                             CTTIME      VARCHAR2(255),
                             VTTIME VARCHAR2(1000),
                             CTID VARCHAR2(255),
                             VTID VARCHAR2(1000));
           TYPE tDataList IS TABLE OF tKeyValue;
           PROCEDURE PR_DO_INSERT(i_lData IN tDataList);     
    END;
    -----------------------------------------------------------------PK_EXCEL_TO_DB PACKAGE BODY-----------------------------------------------------
    PACKAGE BODY PK_EXCEL_TO_DB IS
              PROCEDURE PR_DO_INSERT(i_lData IN tDataList) IS
              CC_ROUTE VARCHAR2(255);
              VV_ROUTE VARCHAR2(1000);
              CC_TRNDATE VARCHAR2(255);
              VV_TRNDATE VARCHAR2(1000);
              CC_TTIME      VARCHAR2(255);
              VV_TTIME VARCHAR2(1000);
              CC_TID VARCHAR2(255);
              VV_TID VARCHAR2(1000);
    BEGIN
            FOR i IN 1..i_lData.count
           LOOP
                        CC_ROUTE:=CC_ROUTE || ',' || i_ldata(i).CROUTE;
                        VV_ROUTE:=VV_ROUTE|| ',''' || i_ldata(i).VROUTE || '''';
                        CC_TRNDATE :=CC_TRNDATE || ',' || i_ldata(i).CTRNDATE ;
                        VV_TRNDATE :=VV_TRNDATE || ',''' || i_ldata(i).VTRNDATE || '''';
                        CC_TTIME :=CC_TTIME || ',' || i_ldata(i).CTTIME ;
                        VV_TTIME :=VV_TTIME || ',''' || i_ldata(i).VTTIME || '''';
                        CC_TID :=CC_TID || ',' || i_ldata(i).CTID ;
                        VV_TID :=VV_TID || ',''' || i_ldata(i).VTID|| '''';
             END LOOP;
              FORMS_DDL('INSERT INTO TEMP2 (' || SUBSTR(CC_ROUTE, 2) || ' ' ||
                                 SUBSTR(CC_TRNDATE, 2) || ' ' ||
                                 SUBSTR(CC_TTIME, 2) || '' ||
                                 SUBSTR(CC_TID, 2) || ')
                    VALUES (' || SUBSTR(VV_ROUTE,2) || ' ' ||
                                    SUBSTR(VV_TRNDATE,2) || '' ||
                                    SUBSTR(VV_TTIME,2) || ' ' ||
                                    SUBSTR(VV_TID,2)|| ')');
    --standard.commit;
          commit;
    END;
    END;Thanks
    Sam
    Edited by: sam8682 on May 13, 2013 2:35 PM

  • Error report: ORA-06531: Reference to uninitialized collection

    I have Procedure like this
    declare
    CURSOR lcu_emp
      IS
        (SELECT *
        FROM
      emp);
    ln_count PLS_INTEGER := 1;
      TYPE emp_TBL_TYPE
    IS
      TABLE OF LCU_emp%ROWTYPE;
      LT_emp emp_TBL_TYPE;
    begin
    FOR Lr_EMP IN LCU_EMP
      LOOP
        ln_count             :=1;
    Lr_EMP.EMP_NO:='1234';  -- updating the loop variable ... just for eg its 1234
    --Transferring the loop variable to collection
    lt_PREV_ASSIGN(ln_count):= Lr_PREV_ASSIGN;   -- THis line its errorring it as Error report: ORA-06531: Reference to uninitialized collection
      END LOOP;
    FOR lr_emp IN lt_emp.FIRST..lt_emp.LAST
      LOOP
    -- printing records when  LT_emp (lr_emp ).emp_no = 1234;
    END LOOP;
    end;Please help how to assign cursor record to collection...
    Thanks
    Vinoth.

    The realtime procedure is below... i thought it will be easy for u guys to understand
    PROCEDURE MAIN(
        P_ERRBUFF OUT VARCHAR2,
        P_RETCODE OUT NUMBER,
        P_BUSINESS_GROUP_ID IN NUMBER,
        P_EFFECTIVE_DATE    IN VARCHAR2,
        p_debug_flag        IN VARCHAR2 )
    AS
      LN_ELEMENT_LINK_ID pay_element_links_f.element_link_id%TYPE;
      LN_INPUT_VALUE_ID1 pay_input_values_f.input_value_id%TYPE;
      LN_INPUT_VALUE_ID2 pay_input_values_f.input_value_id%TYPE;
      ld_effective_start_date pay_element_entries_f.effective_start_date%TYPE;
      LD_EFFECTIVE_END_DATE PAY_ELEMENT_ENTRIES_F.EFFECTIVE_END_DATE%TYPE;
      LN_ELEMENT_ENTRY_ID PAY_ELEMENT_ENTRIES_F.ELEMENT_ENTRY_ID%TYPE;
      ln_object_version_number pay_element_entries_f.object_version_number%TYPE;
      lc_create_warning BOOLEAN;
      CURSOR lcu_prev_assign
      IS
        (SELECT *
        FROM
          (SELECT P_PAAF.ASSIGNMENT_ID PREV_ASSIGNMENT_ID,
            C_PAAF.ASSIGNMENT_ID CURR_ASSIGNMENT_ID,
            PAP.ACCRUAL_PLAN_NAME ACCRUAL_PLAN_NAME,
            APPS.PER_UTILITY_FUNCTIONS.GET_NET_ACCRUAL ( P_PAAF.ASSIGNMENT_ID, P_PAAF.PAYROLL_ID , P_PAAF.BUSINESS_GROUP_ID, -1 , TRUNC(XPPOS.PREV_ACTUAL_TERMINATION_DATE) , PAP.ACCRUAL_PLAN_ID) NET_ACCRUAL,
            XPPOS.PERIOD_OF_SERVICE_ID,
            XPPOS.PERSON_ID,
            XPPOS.CURRENT_DATE_START ,
            XPPOS.PREVIOUS_DATE_START,
            XPPOS.CURR_ACTUAL_TERMINATION_DATE,
            XPPOS.PREV_ACTUAL_TERMINATION_DATE ,
            XPPOS.PREV_LSP_DATE PREV_LSP_DATE,
            P_PAAF.BUSINESS_GROUP_ID PREV_BG_ID ,
            c_paaf.business_group_id curr_bg_id ,
            'N' NEW_ASSIGNMENT_ELEIGIBLE ,
            NULL PTO_ELIGBLE_DATE,
            NULL status,
            NULL ERROR_MESSAGE,
            NULL PREV_ASS_ELEMENT_ENTRY_ID,
            null curr_ass_element_entry_id
          FROM
            (SELECT PERIOD_OF_SERVICE_ID,
              PERSON_ID,
              DATE_START CURRENT_DATE_START,
              LEAD(DATE_START,1,NULL) OVER(PARTITION BY PERSON_ID ORDER BY DMY_ORDER) PREVIOUS_DATE_START,
              ACTUAL_TERMINATION_DATE CURR_ACTUAL_TERMINATION_DATE,
              LEAD(ACTUAL_TERMINATION_DATE,1,NULL) OVER(PARTITION BY PERSON_ID ORDER BY DMY_ORDER) PREV_ACTUAL_TERMINATION_DATE,
              lead(last_standard_process_date ,1,NULL) over(PARTITION BY person_id ORDER BY DMY_ORDER) prev_lsp_date,
              row_number() over (PARTITION BY person_id ORDER BY date_start DESC) DMY_SLCT
            FROM
              (SELECT period_of_service_id ,
                PERSON_ID ,
                DATE_START,
                ACTUAL_TERMINATION_DATE,
                last_standard_process_date,
                COUNT(PERSON_ID) OVER (PARTITION BY PERSON_ID) "CNT",
                row_number() over (PARTITION BY person_id ORDER BY date_start DESC) "DMY_ORDER"
              FROM PER_PERIODS_OF_SERVICE PPOS
          WHERE CNT     >=2
          AND DMY_ORDER IN (1,2)
            ) XPPOS,
            PER_ALL_ASSIGNMENTS_F C_PAAF ,
            PER_ALL_ASSIGNMENTS_F P_PAAF,
            PAY_ELEMENT_ENTRIES_F P_PEEF,
            PAY_ACCRUAL_PLANS PAP,
            PER_PERSON_TYPE_USAGES_F P_PPTUF,
            PER_PERSON_TYPES P_PPT
          WHERE XPPOS.DMY_SLCT =1
          AND C_PAAF.PERSON_ID = XPPOS.PERSON_ID
          AND TRUNC(CURRENT_DATE_START) BETWEEN C_PAAF.EFFECTIVE_START_DATE AND C_PAAF.EFFECTIVE_END_DATE
          AND C_PAAF.PRIMARY_FLAG = 'Y'
          AND P_PAAF.PERSON_ID    = XPPOS.PERSON_ID
          AND TRUNC(prev_actual_termination_date) BETWEEN P_PAAF.EFFECTIVE_START_DATE AND P_PAAF.EFFECTIVE_END_DATE
          AND P_PAAF.PRIMARY_FLAG  = 'Y'
          AND P_PEEF.ASSIGNMENT_ID = P_PAAF.ASSIGNMENT_ID
          AND TRUNC(PREV_ACTUAL_TERMINATION_DATE) BETWEEN P_PEEF.EFFECTIVE_START_DATE AND P_PEEF.EFFECTIVE_END_DATE
          AND PAP.ACCRUAL_PLAN_ELEMENT_TYPE_ID = P_PEEF.ELEMENT_TYPE_ID
          AND C_PAAF.BUSINESS_GROUP_ID         = P_BUSINESS_GROUP_ID
          AND TRUNC(PREV_ACTUAL_TERMINATION_DATE) BETWEEN P_PPTUF.EFFECTIVE_START_DATE AND P_PPTUF.EFFECTIVE_END_DATE
          AND P_PPTUF.PERSON_ID                                                                                                                                                                       = P_PAAF.PERSON_ID
          AND P_PPTUF.PERSON_TYPE_ID                                                                                                                                                                  = P_PPT.PERSON_TYPE_ID
          AND P_PPT.SYSTEM_PERSON_TYPE                                                                                                                                                               IN ('EMP', 'EMP_APL')
          AND P_PAAF.EMPLOYMENT_CATEGORY                                                                                                                                                             IN ('LOCAL' , 'FR')
          AND C_PAAF.ASSIGNMENT_ID                                                                                                                                                                    = 83528
          AND APPS.PER_UTILITY_FUNCTIONS.GET_NET_ACCRUAL ( P_PAAF.ASSIGNMENT_ID, P_PAAF.PAYROLL_ID , P_PAAF.BUSINESS_GROUP_ID, -1 , TRUNC(XPPOS.PREV_ACTUAL_TERMINATION_DATE) , PAP.ACCRUAL_PLAN_ID) <> 0
          ORDER BY NEW_ASSIGNMENT_ELEIGIBLE
        CURSOR LCU_PTO_ELGIBLE(P_ASSIGNMENT_ID NUMBER , P_PLAN_NAME VARCHAR2 , P_EFF_DATE DATE)
        IS
          (SELECT MIN(peef.EFFECTIVE_START_DATE) pto_eligble_date
          FROM PAY_ELEMENT_ENTRIES_F PEEF,
            PAY_ELEMENT_TYPES_F PETF
          WHERE PEEF.ASSIGNMENT_ID = P_ASSIGNMENT_ID
          AND PETF.element_NAME    = P_PLAN_NAME
          AND TRUNC(p_eff_date) BETWEEN petf.effective_start_date AND petf.effective_end_date
        CURSOR LCU_ELEMENT_LINK(p_plan_name VARCHAR2,p_eff_date DATE)
        IS
          (SELECT PIVF1.INPUT_VALUE_ID INPUT_VALUE_ID1,
            PIVF2.INPUT_VALUE_ID INPUT_VALUE_ID2,
            PELF.ELEMENT_LINK_ID
          FROM PAY_ELEMENT_LINKS_F PELF ,
            PAY_ELEMENT_TYPES_F PETF,
            pay_input_values_f pivf1 ,
            pay_input_values_f pivf2
          WHERE PELF.ELEMENT_TYPE_ID = PETF.ELEMENT_TYPE_ID
          AND PIVF1.ELEMENT_TYPE_ID  = PETF.ELEMENT_TYPE_ID
          AND PIVF2.ELEMENT_TYPE_ID  = PETF.ELEMENT_TYPE_ID
          AND TRUNC(P_EFF_DATE) BETWEEN PELF.EFFECTIVE_START_DATE AND PELF.EFFECTIVE_END_DATE
          AND TRUNC(P_EFF_DATE) BETWEEN PETF.EFFECTIVE_START_DATE AND PETF.EFFECTIVE_END_DATE
          AND TRUNC(P_EFF_DATE) BETWEEN PIVF1.EFFECTIVE_START_DATE AND PIVF1.EFFECTIVE_END_DATE
          AND TRUNC(p_eff_date) BETWEEN pivf2.effective_start_date AND pivf2.effective_end_date
          AND ELEMENT_NAME = p_plan_name
            ||' RollOver Adj'
          AND PIVF2.NAME             = 'Hours'
          AND PIVF1.NAME             = 'Effective Date'
          AND petf.BUSINESS_GROUP_ID = P_BUSINESS_GROUP_ID
        ln_count PLS_INTEGER := 1;
      TYPE PREV_ASSIGN_TBL_TYPE
    IS
      TABLE OF LCU_PREV_ASSIGN%ROWTYPE;
      LT_PREV_ASSIGN PREV_ASSIGN_TBL_TYPE;
      --LR_PREV_ASSIGN LCU_PREV_ASSIGN%ROWTYPE;
      --Lb_PREV_ASSIGN LCU_PREV_ASSIGN%ROWTYPE;
    BEGIN
      FOR Lr_PREV_ASSIGN IN LCU_PREV_ASSIGN
      LOOP
        ln_count             :=1;
        LN_ELEMENT_LINK_ID   := NULL;
        LN_INPUT_VALUE_ID1   := NULL;
        LN_INPUT_VALUE_ID2   := NULL;
        FOR LRU_ELEMENT_LINK IN LCU_ELEMENT_LINK (Lr_PREV_ASSIGN.ACCRUAL_PLAN_NAME,LR_PREV_ASSIGN.PREV_LSP_DATE )
        LOOP
          LN_ELEMENT_LINK_ID :=LRU_ELEMENT_LINK.ELEMENT_LINK_ID;
          LN_INPUT_VALUE_ID1 := LRU_ELEMENT_LINK.input_value_id1;
          LN_INPUT_VALUE_ID2 := LRU_ELEMENT_LINK.INPUT_VALUE_ID2;
          BEGIN
            apps.pay_element_entry_api.create_element_entry ( P_EFFECTIVE_DATE => LR_PREV_ASSIGN.PREV_LSP_DATE, P_BUSINESS_GROUP_ID => LR_PREV_ASSIGN.PREV_BG_ID ,p_assignment_id => Lr_PREV_ASSIGN.prev_assignment_id ,p_element_link_id => ln_element_link_id ,p_entry_type => 'E'
            --,p_creator_type => 'F'
            --,p_cost_allocation_keyflex_id => cost_keyflex_id
            --,p_date_earned => l_week_ending_date
            ,p_input_value_id1 => LN_INPUT_VALUE_ID1 ,p_input_value_id2 => LN_INPUT_VALUE_ID2
            --,p_input_value_id3 => l_inp_value3_id
            --,p_input_value_id4 => l_inp_value4_id
            ,P_ENTRY_VALUE1 => LR_PREV_ASSIGN.PREV_ACTUAL_TERMINATION_DATE ,p_entry_value2 => (-1)* LR_PREV_ASSIGN.net_accrual
            --,p_entry_value3 => l_constant_all_deductions
            --,p_entry_value4 => l_constant_no
            ,p_effective_start_date => ld_effective_start_date ,p_effective_end_date => ld_effective_end_date ,p_element_entry_id => ln_element_entry_id ,p_object_version_number => ln_object_version_number ,P_CREATE_WARNING => LC_CREATE_WARNING );
            LR_PREV_ASSIGN.STATUS                    :='P';
            Lr_PREV_ASSIGN.prev_ass_element_entry_id := ln_element_entry_id;
          EXCEPTION
          WHEN OTHERS THEN
            LR_PREV_ASSIGN.STATUS        :='E';
            Lr_PREV_ASSIGN.error_message := SQLERRM;
          END;
        END LOOP;
        FOR LR_PTO_ELGIBLE IN LCU_PTO_ELGIBLE(LR_PREV_ASSIGN.CURR_ASSIGNMENT_ID ,LR_PREV_ASSIGN.ACCRUAL_PLAN_NAME , LR_PREV_ASSIGN.CURRENT_DATE_START )
        LOOP
          LR_PREV_ASSIGN.NEW_ASSIGNMENT_ELEIGIBLE := 'Y';
          LR_PREV_ASSIGN.pto_eligble_date         := LR_PTO_ELGIBLE.pto_eligble_date ;
        END LOOP;
        IF(LR_PREV_ASSIGN.STATUS = 'P')
        then
        BEGIN
            apps.pay_element_entry_api.create_element_entry (
            P_EFFECTIVE_DATE => LR_PREV_ASSIGN.pto_eligble_date ,
            P_BUSINESS_GROUP_ID => LR_PREV_ASSIGN.CURR_BG_ID ,
            P_ASSIGNMENT_ID => LR_PREV_ASSIGN.CURR_ASSIGNMENT_ID ,
            P_ELEMENT_LINK_ID => LN_ELEMENT_LINK_ID ,
            p_entry_type => 'E'
            --,p_creator_type => 'F'
            --,p_cost_allocation_keyflex_id => cost_keyflex_id
            --,p_date_earned => l_week_ending_date
            ,P_INPUT_VALUE_ID1 => LN_INPUT_VALUE_ID1
            ,p_input_value_id2 => LN_INPUT_VALUE_ID2
            --,p_input_value_id3 => l_inp_value3_id
            --,p_input_value_id4 => l_inp_value4_id
            ,P_ENTRY_VALUE1 => LR_PREV_ASSIGN.PTO_ELIGBLE_DATE ,
            p_entry_value2 =>  LR_PREV_ASSIGN.net_accrual
            --,p_entry_value3 => l_constant_all_deductions
            --,p_entry_value4 => l_constant_no
            ,P_EFFECTIVE_START_DATE => LD_EFFECTIVE_START_DATE ,
            P_EFFECTIVE_END_DATE => LD_EFFECTIVE_END_DATE ,
            P_ELEMENT_ENTRY_ID => LN_ELEMENT_ENTRY_ID ,
            P_OBJECT_VERSION_NUMBER => LN_OBJECT_VERSION_NUMBER ,
            P_CREATE_WARNING => LC_CREATE_WARNING );
            LR_PREV_ASSIGN.STATUS                    :='S';
            LR_PREV_ASSIGN.CURR_ASS_ELEMENT_ENTRY_ID := LN_ELEMENT_ENTRY_ID;
            commit;
          EXCEPTION
          WHEN OTHERS THEN
          rollback;
            LR_PREV_ASSIGN.STATUS        :='E';
            LR_PREV_ASSIGN.ERROR_MESSAGE := SQLERRM;
          END;
          END IF;
        lt_PREV_ASSIGN(ln_count):= Lr_PREV_ASSIGN;
    ln_count:=ln_count+1;
      END LOOP;
      FOR lr_prev_assign IN lt_prev_assign.FIRST..lt_prev_assign.LAST
      LOOP
      IF(lt_prev_assign(lr_prev_assign).status = 'E')
      THEN
      FND_FILE.PUT_LINE(FND_FILE.LOG,lt_prev_assign(lr_prev_assign).error_message);
      end if;
        --print the error records here
      END LOOP;
    END MAIN;

  • Ora-06531 reference to uninitialized collection

    Hello,
    I am getting this "ora-06531 reference to uninitialized collection" while executing the below procedure.
    =======================
    PROCEDURE iud_account_col
    ( pv_account_version IN account_version_t
    AS
    LC_USR_ID CONSTANT VARCHAR2(30) := pkg_util.get_usr_id ;
    LC_TMSTMP CONSTANT TIMESTAMP /*WITH TIME ZONE*/ := pkg_util.get_tmstmp ;
    lv_level VARCHAR2(100);
    lv_am_key_id number;
    lv_acct_cusip VARCHAR2(12);
    LC_AM_KEY_ID number;
    LC_AM_VER_NUM number;
    BEGIN
    DECLARE
    lv_am account_version_t;
    lv_amv account_maint_t;
    lv_amvv account_maint_version_t;
    cursor c_acct_cusip ( cv_am_key_id varchar2) is
    select acct_cusip
    from account_maintenance
    where am_key_id = lv_amv.am_key_id;
    BEGIN
    lv_am := pv_account_version;
    lv_level := 'ACCOUNT_MAINT' ;
    lv_amv := pv_account_version.account_maint;
    LC_AM_KEY_ID := lv_amv.am_key_id;
    FOR acct_cusip_info in c_acct_cusip (lv_am_key_id)
    LOOP
    lv_acct_cusip := acct_cusip_info.acct_cusip;
    END LOOP;
    IF lv_amv.action = 'I'
    THEN
    INSERT
    INTO
    account_maintenance
    ( am_key_id
    , acct_cusip
    , am_orig_cre_tmstp
    , am_orig_usr_id
    , delete_ind
    , add_usr_id
    , add_tmstmp
    , lock_level_num
    VALUES
    ( lv_amv.am_key_id
    , lv_amv.acct_cusip
    , LC_TMSTMP
    , LC_USR_ID
    , lv_amv.delete_ind
    , LC_USR_ID
    , LC_TMSTMP
    , lv_amv.lock_level_num
    END IF;
    lv_amvv := pv_account_version.account_maint.account_maint_version;
    lv_level := 'ACCOUNT_MAINT_VERSION';
    LC_AM_VER_NUM := lv_amvv.am_ver_num;
    IF lv_amvv.action = 'I'
    THEN
    -- Insert issue maint version
    INSERT
    INTO
    ACCOUNT_MAINTENANCE_VERSION
    ( AM_KEY_ID
    , AM_VER_NUM
    , ACCT_CUSIP
    , LEGAL_ENTITY
    , APPR_STATUS_REF_ID
    , INACTIVE_IND
    , ADD_USR_ID
    , ADD_TMSTMP
    , UPD_USR_ID
    , UPD_TMSTMP
    , LOCK_LEVEL_NUM
    VALUES
    ( lv_amv.am_key_id
    , lv_amvv.am_ver_num
    , lv_acct_cusip
    , lv_amvv.legal_entity
    , lv_amvv.appr_status_ref_id
    , 'N'
    , LC_USR_ID
    , LC_TMSTMP
    , LC_USR_ID
    , LC_TMSTMP
    , lv_amvv.lock_level_num
    END IF; --- end for account maint version.
    FOR j IN lv_amv.account_maint_comment_col.FIRST
    .. lv_amv.account_maint_comment_col.LAST
    LOOP
    DECLARE
    lv_amvc account_maint_comment_t;
    BEGIN
    lv_amvc := lv_amv.account_maint_comment_col(j);
    lv_level := 'ACCOUNT_MAINT_COMMENT';
    IF lv_amvc.action = 'I'
    THEN
    --- Insert into account maintenance comment table
    INSERT
    INTO
    ACCOUNT_MAINTENANCE_COMMENT
    ( AM_KEY_ID
    , AM_VER_NUM
    , COMMENT_NUM
    , COMMENT_TMSTP
    , COMMENT_TXT
    , INACTIVE_IND
    , ADD_USR_ID
    , ADD_TMSTMP
    , LOCK_LEVEL_NUM
    VALUES
    ( LC_AM_KEY_ID
    , LC_AM_VER_NUM
    , lv_amvc.comment_num
    , LC_TMSTMP
    , lv_amvc.comment_txt
    , 'N'
    , LC_USR_ID
    , LC_TMSTMP
    , lv_amvc.lock_level_num
    END IF;
    END;
    END LOOP; --- end loop for account maint comments
    END;
    COMMIT WORK;
    RETURN;
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK WORK;
    RAISE;
    END iud_account_col;
    ====================
    The UDT's are below:
    CREATE OR REPLACE TYPE ACCOUNT_VERSION_T
    AS OBJECT
    PORTFOLIO PORTFOLIO_T
    , ACCOUNT_MAINT ACCOUNT_MAINT_T
    CREATE OR REPLACE TYPE ACCOUNT_MAINT_T
    AS OBJECT
    ( AM_KEY_ID number
    , ACCT_CUSIP varchar2(12)
    , DELETE_IND varchar2(1)
    , ADD_USR_ID varchar2(20)
    , ADD_TMSTMP timestamp
    , UPD_USR_ID varchar2(20)
    , UPD_TMSTMP timestamp
    , LOCK_LEVEL_NUM number
    , ACTION VARCHAR2(1)
    , ACCOUNT_MAINT_VERSION ACCOUNT_MAINT_VERSION_T
    , ACCOUNT_MAINT_COMMENT_COL ACCOUNT_MAINT_COMMENT_COL_T
    CREATE OR REPLACE TYPE ACCOUNT_MAINT_VERSION_T
    AS OBJECT
    ( AM_KEY_ID number
    , AM_VER_NUM number
    , ACCT_CUSIP varchar2(12)
    , LEGAL_ENTITY varchar2(100)
    , APPR_STATUS_REF_ID number
    , FUND_INACTIVE_TMSTMP timestamp
    , ADD_USR_ID varchar2(20)
    , ADD_TMSTMP timestamp
    , UPD_USR_ID varchar2(20)
    , UPD_TMSTMP timestamp
    , LOCK_LEVEL_NUM number
    , ACTION VARCHAR2(1)
    CREATE OR REPLACE TYPE ACCOUNT_MAINT_COMMENT_T
    AS OBJECT
    ( AM_KEY_ID number
    , AM_VER_NUM number
    , COMMENT_NUM number
    , COMMENT_TXT varchar2(400)
    , ADD_USR_ID varchar2(20)
    , ADD_TMSTMP timestamp
    , UPD_USR_ID varchar2(20)
    , UPD_TMSTMP timestamp
    , LOCK_LEVEL_NUM number
    , ACTION VARCHAR2(1)
    CREATE OR REPLACE TYPE ACCOUNT_MAINT_COMMENT_COL_T AS TABLE OF ACCOUNT_MAINT_COMMENT_T;
    =====================================================
    This is how I am trying to execute:
    Declare
    pv_account_version account_version_t := account_version_t(null
    , account_maint_t ( 10041
    , '11111111'
    , 'N'
    ,'abc'
    , NULL
    , NULL
    , NULL
    , 1
    ,NULL-- 'I'
    ,ACCOUNT_MAINT_VERSION_T(10031
    , 10001
    , NULL
    ,'Legal entity'
    ,22
    ,NULL
    ,'abc'
    ,NULL
    , NULL
    ,NULL
    , 1
    ,NULL --'I'
    ,ACCOUNT_MAINT_COMMENT_COL_T(
    10031
    ,10001
    ,1001
    ,'My first comment'
    ,'abc'
    , NULL
    , NULL
    , NULL
    , 1
    , 'I')
    Begin
    pkg_cdm_process_v2.iud_account(pv_account_version);
    END;
    SQL> /
    Declare
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "ACEENG.PKG_CDM_PROCESS_V2", line 799
    ORA-06512: at line 27
    What am I doing wrong here....
    Please help.

    Hi,
    Here is the table structures, data is in my procedure call.
    I get error only while testing for 'account_maintenance_comment' table, if I comment this part in my procedure, i won't get this error.
    CREATE TABLE ACCOUNT_MAINTENANCE
    AM_KEY_ID NUMBER(32) NOT NULL,
    ACCT_CUSIP VARCHAR2(12) NOT NULL,
    AM_ORIG_CRE_TMSTP TIMESTAMP(6) NOT NULL,
    AM_ORIG_USR_ID VARCHAR2(20) NOT NULL,
    DELETE_IND VARCHAR2(1) NULL,
    ADD_USR_ID VARCHAR2(20) NOT NULL,
    ADD_TMSTMP TIMESTAMP(6) NOT NULL,
    UPD_USR_ID VARCHAR2(20) NULL,
    UPD_TMSTMP TIMESTAMP(6) NULL,
    LOCK_LEVEL_NUM NUMBER(32) NOT NULL
    CREATE TABLE ACCOUNT_MAINTENANCE_VERSION
    AM_KEY_ID NUMBER(32) NOT NULL,
    AM_VER_NUM NUMBER(32) NOT NULL,
    ACCT_CUSIP VARCHAR2(12) NOT NULL,
    SNAME VARCHAR2(20) NULL,
    LNAME VARCHAR2(40) NULL,
    EXT_ACCT_NUM NUMBER NULL,
    ADVISOR_NM VARCHAR2(40) NULL,
    SUB_ADVISOR_NM VARCHAR2(40) NULL,
    LEGAL_ENTITY VARCHAR2(100) NULL,
    DISP_PWR_ADVISOR_NM VARCHAR2(40) NULL,
    VOT_PWR_ADVISOR_NM VARCHAR2(40) NULL,
    ACCT_TYP_CD VARCHAR2(10) NULL,
    ACCT_PUBLIC_NM VARCHAR2(40) NULL,
    CLIENT_TYP_CD VARCHAR2(1) NULL,
    CUSTODIAN_NM VARCHAR2(40) NULL,
    NATIONALITY VARCHAR2(40) NULL,
    PORTF_TEST_IND VARCHAR2(1) NULL,
    PILOT_PORTF_IND VARCHAR2(1) NULL,
    ELIG_IND_13DG VARCHAR2(1) NULL,
    RR_EXCLUDE_IND VARCHAR2(1) NULL,
    APPR_STATUS_REF_ID NUMBER(32) NULL,
    NEXT_REVIEW_TMSTMP TIMESTAMP(6) NULL,
    FUND_INACTIVE_TMSTMP TIMESTAMP(6) NULL,
    LAST_APPR_USR_ID VARCHAR2(20) NULL,
    LAST_APPR_TMSTMP TIMESTAMP(6) NULL,
    INACTIVE_IND VARCHAR2(1) NOT NULL,
    ADD_USR_ID VARCHAR2(20) NOT NULL,
    ADD_TMSTMP TIMESTAMP(6) NOT NULL,
    UPD_USR_ID VARCHAR2(20) NULL,
    UPD_TMSTMP TIMESTAMP(6) NULL,
    LOCK_LEVEL_NUM NUMBER(32) NOT NULL,
    CREATE TABLE ACCOUNT_MAINTENANCE_COMMENT
    AM_KEY_ID NUMBER(32) NOT NULL,
    AM_VER_NUM NUMBER(32) NULL,
    COMMENT_NUM NUMBER(32) NOT NULL,
    COMMENT_TMSTP TIMESTAMP(6) NOT NULL,
    COMMENT_TXT VARCHAR2(400) NULL,
    INACTIVE_IND VARCHAR2(1) NOT NULL,
    ADD_USR_ID VARCHAR2(20) NOT NULL,
    ADD_TMSTMP TIMESTAMP(6) NOT NULL,
    UPD_USR_ID VARCHAR2(20) NULL,
    UPD_TMSTMP TIMESTAMP(6) NULL,
    LOCK_LEVEL_NUM NUMBER(32) NOT NULL)

  • Reference to Uninitialized collection error

    Hi ,
    I am invoking one wrapper API from Database Adapter in Oracle soa suite 11g . The structure of the wrapper is
    1. employee
    -->(1..n)employee sites
    --->(1..n)employee contacts
    I am just trying to invoking API for creation of employee record without sites and contacts and it is throwing me the following error message
    -123456 TESTING66 FUEL CONVERSION Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'EMPLOYEEWRAPPER' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the APPS.BPEL_EMPLOYEEWRAPPER.XXWFS_EMPLOYEES_SOA$CREATE_EMP API. An error occurred while preparing and executing the APPS.BPEL_EMPLOYEEWRAPPER.XXWFS_EMPLOYEE_SOA$CREATE_EMP API. Cause: java.sql.SQLException: ORA-06531: Reference to uninitialized collection ORA-06512: at "APPS.BPEL_EMPLOYEEWRAPPER", line 196 ORA-06512: at "APPS.BPEL_EMPLOYEEWRAPPER", line 262 ORA-06512: at line 1 ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. ORA-06531: Reference to uninitialized collection ORA-06512: at "APPS.BPEL_EMPLOYEEWRAPPER", line 196 ORA-06512: at "APPS.BPEL_EMPLOYEEWRAPPER", line 262 ORA-06512: at line 1 6531
    passing site and contact details are not mandatory one
    But when i am passing the employeesite and employee contact then it is not throwing this error message and the big strange thing is it is perfectly working when calling in sql prompt.
    Please help me...
    Thanks,

    1..n means the elements needs to be in the payload itself when calling the db adapter
    so skipping the elements isn't an option.
    the smallest payload you can use should be something like
    <employee>
    <employee sites/>
    <employee contacts/>
    </employee>

  • Reference to uninitialized collection

    Hi,
    I have created a Java stored procedure as follows:
    Type declaration:
    CREATE OR REPLACE TYPE transArray AS TABLE OF NUMBER(20)
    /Stored Java Class:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED testCompTrans AS
    import java.math.BigDecimal;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.Statement;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import java.text.SimpleDateFormat;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    public class testCompTrans {
         public static void callCompTrans(oracle.sql.ARRAY[] returnCompTrans, int memId, int month,
              int year, int freq, int empWrkgDays, BigDecimal baseSalary, BigDecimal agreedCurrRate,
              String paycycle, String cutoff, String companyCode, String payCurrCode, Date dateJoined){
              int arrayLength = 2;
              BigDecimal[] trans = new BigDecimal[arrayLength];
              BigDecimal rate = new BigDecimal("0");
              try{
                   prorate = compProrate(memId, month, year, freq, empWrkgDays, baseSalary, agreedCurrRate, paycycle,
                             cutoff, companyCode, payCurrCode, dateJoined);
                   for(int i=0;i<arrayLength;i++){
                        rate = trans;
                        System.out.println(rate);
                   Connection conn = DriverManager.getConnection("jdbc:default:connection:");
                   ArrayDescriptor desc = ArrayDescriptor.createDescriptor("transArray",conn);
                   returnCompTrans[0] = new ARRAY(desc,conn,prorate);
              }catch (Exception e){
                   e.printStackTrace();
         }Stored procedure: (from a package)PROCEDURE SP_COMPTRANS(returnCompTrans OUT transArray, memId IN NUMBER, payMonth IN NUMBER, payYear IN NUMBER, freq IN NUMBER,
    empWrkgDays IN NUMBER, baseSalary IN NUMBER, agreedCurrRate IN NUMBER, paycycle IN VARCHAR2, cutOff IN VARCHAR2,
    companyCode IN VARCHAR2, payCurrCode IN VARCHAR2, dateJoined IN DATE)
    AS LANGUAGE JAVA
    NAME 'ori.payroll.OriCompProrate.callCompProrate(oracle.sql.ARRAY[], int, int, int, int, int, java.math.BigDecimal, java.math.BigDecimal, java.lang.String, java.lang.String,
    java.lang.String, java.lang.String, java.util.Date)';
    I have another stored procedure which will call and process this for each employee - SP_PAYRUN. I just added this:
    Initialization:CREATE OR REPLACE PROCEDURE SP_PAYRUN(EMP_FROM VARCHAR2, EMP_TO VARCHAR2, PAY_YEAR NUMBER, PAY_MONTH NUMBER)
    AS
    ARRAYTRANS testArray := testArray(); .....
    PG_PAY_RUN.SP_COMPTRANS(ARRAYTRANS, MEMID, PAY_MONTH, PAY_YEAR, FREQ, MTH_WRKG_DAYS, BASE_SALARY, AGREED_CURR_RATE,
    PAYCYCLE, 'PY', COMP_CODE, PAY_CURR_CODE, JOINED_DATE);
    --I just added this to check the result:
    BASE_SALARY := ARRAYTRANS(1);
    DBMS_OUTPUT.PUT_LINE(BASE_SALARY);Then, executed the SP_PAYRUN in SQL* Plus:set serveroutput on size 20000
    execute SP_PAYRUN('2345', '29708161', 2008, 1);this outputs the base_salary but only after 3 or 4 employees and then I get this error:
    BEGIN SP_PAYROLLRUN('2345', '29708161', 2008, 1); END;
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "SP_PAYRUN", line 270
    ORA-06512: at line 1
    I have tried testing my java stored procedure with only one employee and it worked.
    The stored procedure should return 21 employees.  What could be the problem with this? Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    thanks for your reply. I've also visited this link and already added above the solution it gave:
    I have another stored procedure which will call and process this for each employee - SP_PAYRUN. I just added this:
    Initialization:
    CREATE OR REPLACE PROCEDURE SP_PAYRUN(EMP_FROM VARCHAR2, EMP_TO VARCHAR2, PAY_YEAR NUMBER, PAY_MONTH NUMBER)
    AS
    ARRAYTRANS testArray := testArray(); The procedure returns something but not all. I was expecting 21 data but it only returned the first 3 or 4 or sometimes 5..

  • ORA-06530: Reference to uninitialized composite

    I have,
    Created an Object:
    CREATE OR REPLACE  TYPE opt_val_rec AS  OBJECT (
        parametervalue     VARCHAR2(1),
        PARAMETERID          varchar2(4000)
        );Created a table type:
         create  OR REPLACE  type  OPTVAL_TAB as  table of OPT_VAL_REC;
         Procedure to get the values into table type:
    Create or replace  procedure test_parm_val (id in varchar2 ,result out  varchar2) as
    pos number:=0;
      test_paramval                                 OPTVAL_TAB:= OPTVAL_TAB (null);
    paramval_ord   OPTVAL_TAB:= OPTVAL_TAB (null);
    begin
    for I in (select DISTINCT param_name from  param_tbl)
    loop
    test_paramval.extend(10);
    POS :=POS+1;
    test_paramval (POS).PARAMETERVALUE:= get_param_val_fnc(id,I.PARAM_NAME);
    test_paramval(POS). parameterid:=I.PARAM_NAME;
    end loop;
    SELECT CAST (MULTISET( SELECT  pv.PARAMETERVALUE,
                                       pv.parameterid
                                FROM TABLE (PARAMVAL)pv
                                                                                                      ORDER BY pv.PARAMETERVALUE)
                             AS OPTVAL_TAB)
        INTO paramval_ord
        FROM dual;*/
    exception
    when others then
    NULL;
    End;
    end test_parm_valNow when executing the procedure, facing the above error mentioned in the subject.
    Please help.

    You initialized collection but not the object:
    SQL> declare
      2      pos number:=0;
      3      test_paramval OPTVAL_TAB:= OPTVAL_TAB (null);
      4  begin
      5      test_paramval.extend(10);
      6      POS :=POS+1;
      7      test_paramval (POS).PARAMETERVALUE:= 'X';
      8      test_paramval(POS). parameterid:='Y';
      9  end;
    10  /
    declare
    ERROR at line 1:
    ORA-06530: Reference to uninitialized composite
    ORA-06512: at line 7
    SQL> declare
      2      pos number:=0;
      3      test_paramval OPTVAL_TAB:= OPTVAL_TAB (null);
      4  begin
      5      test_paramval.extend(10);
      6      POS :=POS+1;
      7      test_paramval (POS) := opt_val_rec(null,null);
      8      test_paramval (POS).PARAMETERVALUE:= 'X';
      9      test_paramval(POS). parameterid:='Y';
    10  end;
    11  /
    PL/SQL procedure successfully completed.
    SQL> -- or better
    SQL> declare
      2      pos number:=0;
      3      test_paramval OPTVAL_TAB:= OPTVAL_TAB (null);
      4  begin
      5      test_paramval.extend(10);
      6      POS :=POS+1;
      7      test_paramval (POS) := opt_val_rec('X','Y');
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> So change:
    test_paramval (POS).PARAMETERVALUE:= get_param_val_fnc(id,I.PARAM_NAME);
    test_paramval(POS). parameterid:=I.PARAM_NAME;to
    test_paramval(POS) := opt_val_rec(get_param_val_fnc(id,I.PARAM_NAME),I.PARAM_NAME);SY.

  • ITunes Match has messed up my entire music collection - please help me

    Does anyone else have a problem with iTunes Match splitting their albums? I have been happily using iTunes for my entire music collection (round 800 albums) but it became a disaster the day I turned on Match. Where an album has a guest contributor on a track, it removes that track and places it separately, same album name and cover, but with the individual track(s). Some albums have been split across more than 7 individual album entries.  The changes appear to be permanent. Turning off Match does not cure the problem. Removing the album and reloading it doesn't cure the problem. I have been through and individually altered each album track to say that it it part of the same album. This results in the album tracks places together but then shows the album as 'unknown artist' so I can't view my music properly. I am at my wits end with this. Please help.

    Hi,
    This is not a match issue but a general iTunes problem - read this article http://samsoft.org.uk/iTunes/grouping.asp
    Jim

  • Garbage Collection--please help

    My garbage collection logs look as follows:
    <pre>
    (1)342.003: [GC 342.003: [DefNew
    Desired survivor size 819200 bytes, new threshold 1 (max 4)
    - age   1:    1153152 bytes,    1153152 total
    : 13184K->1126K(14784K), 0.0221720 secs] 13184K->1126K(63936K), 0.0227740 secs] [Times: user=0.00 sys=0.02, real=0.03 secs]
    768.603: [GC [1 CMS-initial-mark: 0K(49152K)] 7114K(63936K), 0.0062870 secs]
    (2)1358.802: [GC 1358.802: [DefNew
    Desired survivor size 819200 bytes, new threshold 4 (max 4)
    - age   1:     785520 bytes,     785520 total
    : 14310K->767K(14784K), 0.0680510 secs] 14310K->1700K(63936K) icms_dc=5 , 0.0682220 secs] [Times: user=0.00 sys=0.03, real=0.07 secs]
    1847.304: [GC [1 CMS-initial-mark: 932K(49152K)] 8210K(63936K), 0.0058360 secs]
    (3)2537.684: [GC 2537.684: [DefNew
    Desired survivor size 819200 bytes, new threshold 2 (max 4)
    - age   1:     815688 bytes,     815688 total
    - age   2:     171848 bytes,     987536 total
    : 13951K->964K(14784K), 0.0402100 secs] 14800K->1813K(63936K) icms_dc=0 , 0.0407760 secs]
    </pre>
    I don't know why a concurrent collection is initiated in (2) despite the new threshold is 4.
    Why there is no age 2, age 3 and age 4 collection? In (1) and (3), collection occurs as promised, once when the new threshold is 1 and twice when the new threshold is twice.
    May be the numbers in (2) tell me something, but I don't know how to interpret them.
    Please help.
    Thank you.

    It looks like you are running into what is sometimes called the "Young Generation
    Guarantee" in Sun's JVM. See
    http://java.sun.com/docs/hotspot/gc1.4.2/#3.2.1.%20Young%20Generation%20Guarantee|outline
    You have a large young generation and there might not be a contiguous
    chunk in the tenured generation that is large enough to hold all of the
    young generation. Try cutting your young generation down to 128m and
    see if that helps. You can also take a look at
    http://blogs.sun.com/jonthecollector/entry/what_the_heck_s_a
    You're running into a "concurrent mode failure" although that is not explicitly
    spelled out in 1.4.2.
    And go back to the regular (not incremental) version of UseConcMarkSweepGC.

  • ORA-01000: maximum open cursors exceeded (please help / JDBC guru needed)

    ORA-01000: maximum open cursors exceeded
    I am getting this error when trying to execute 2,500 Sql DDL statements. I am executing the statement with:
    public boolean execute(String sql) ( like stmt.execute(sql); )
    After each execute() I close the statement ( like stmt.close() )
    I tried taking this a step further and decided to close and reopen the database connection after every 100 Sql statements processed and I still get this exception when continuing.
    ORA-01000: maximum open cursors exceeded
    Any help will be greatly appreciated. I need to figure how to close the cursors or how to finish processing all 2,500 statements. I do not have control over the init.ora file and can not increase the max cursors. I hope to figure out how to close the cursors so that no tweaking of the init.ora file is needed.
    ChrisTD

    Why dont you allocate dukes for this problem ???
    am getting this error when trying to execute 2,500 Sql DDL statements. I am executing the statement with:
    public boolean execute(String sql) ( like stmt.execute(sql); )
    After each execute() I close the statement ( like stmt.close() )
    What kind of DDL is that? are you using any cursor operations to fetch the data? What kind of query does this sql parameter contain?
    Look there is only 3 solutions for this kind of problem.
    1) shutdown the database and restart it.
    I dont think closing connection will shutdown the database as you
    told.
    2) shutdown the database access init.ora and increase the
    OPEN_CURSORS and then restart it.
    You told that you dont have access to init.ora.
    3) close every cursor that you open.(Probably you are not closing the cursor once you fetch the data).

  • ORA-01033 Error... Please Help!

    Dear all expert,
    After Re-boot the computer, The system show the following error code; Kindly provide solution for me to fixed this case..
    Thank of all Expert.
    The Error message reference to the following:
    SQL&gt; shutdown immediate
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SQL&gt;
    SQL&gt; startup
    ORACLE instance started.
    Total System Global Area 135338868 bytes
    Fixed Size 453492 bytes
    Variable Size 109051904 bytes
    Database Buffers 25165824 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    ORA-00333: redo log read error block 90114 count 8192

    Dear Donald Spry
    I have try you suggestion to run the command in SQL Plus. But Have The following Error:
    SQL*Plus: Release 9.2.0.1.0 - Production on Mon May 12 22:53:58 2003
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    SQL> startup mount;
    ORA-01081: cannot start already-running ORACLE - shut it down first
    SQL> shutdown abort
    ORACLE instance shut down.
    SQL> startup mount;
    ORACLE instance started.
    Total System Global Area 135338868 bytes
    Fixed Size 453492 bytes
    Variable Size 109051904 bytes
    Database Buffers 25165824 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    SQL> alter database recover automatic;
    alter database recover automatic
    ERROR at line 1:
    ORA-00283: recovery session canceled due to errors
    ORA-00333: redo log read error block 90114 count 8192
    SQL> alter database open;
    alter database open
    ERROR at line 1:
    ORA-00333: redo log read error block 90114 count 8192
    Please Let me know how can I do? Is it need me to re-install the Oracle 9i?
    Thousand Thanks!!
    Best Regrads
    Vincent Chan

  • Object as Reference not working..Please help..!!!

    public class GG{
    public static void main(String[] args) {
    Integer i = new Integer(10);
    System.out.println("Before Call:"+i);
    change(i);
    System.out.println("After Call:"+i);
    public static void change(Integer x){
    x=20;
    Here the output is coming
    Before Call:10
    After Call:10
    I am confused when i am passing an object in a function then why the value is not changed as objects are passed by reference??

    Java is pass-by-value. Recommended reading:
    [http://www.javaranch.com/campfire/StoryCups.jsp]
    [http://www.javaranch.com/campfire/StoryPassBy.jsp]
    This topic has been done to death too many times already. I'm moving this thread to New to Java and locking this it. Jasvinder.Singh, please confine your questions to the New to Java forum until such time as you can regard yourself as a Java Programmer.
    db

  • Accidently deleted entire itunes collection - please help!

    Hi,
    My itunes folder was on an external drive. I accidently copied an empty itunes folder, pasted it over the full one and clicked 'Replace'. Hence all my files are gone!!
    I have an older version of my library on my ipod. I am afraid to plug it into the MAC, in case I loose everything on that too. I though maybe if I plug it in, as the files are deleted on the MAC, it will 'sync' with the ipod and delete on there too.
    Bascially, i want to just get everything off the ipod onto the MAC with no risk of loosing everything. Please could something give me clear and accurate advise on how to do this!
    Thank you so much

    First off, you are in the wrong forum. This is the iTunes for WINDOWS forum. But anyway...
    Second, PLEASE PLEASE PLEASE, invest the $100 or whatever in an external hard drive and make a backup of your iTunes library after you get it back.
    Copying from iPod to Computer threads...
    http://discussions.apple.com/thread.jspa?threadID=1300144
    http://discussions.apple.com/thread.jspa?messageID=797432&#797432
    http://discussions.apple.com/thread.jspa?threadID=809624&tstart=0
    Also these useful internet articles...
    http://www.ilounge.com/index.php/articles/comments/copying-music-from-ipod-to-co mputer/
    http://www.engadget.com/2004/11/02/how-to-get-music-off-your-ipod/
    http://playlistmag.com/help/2005/01/2waystreet/
    Good luck!
    Patrick

  • Long pauses during ParNew garbage collection Please Help !

    Hi,
    We are running a server application on an large machine (~120 CPU, ~380 GB Memory).
    After running 1 or 2 hours we suddenly get exorbitant application pause times during garbage collection and a massive cpu usage from the java vm
    We are running on Java 6 (64Bit) with 6GB Heap.
    Concurrent garbage collection is turned on using the parameters:
    -XX:+UseConcMarkSweepGC
    -XX:+CMSParallelRemarkEnabled
    -XX:CMSInitiatingOccupancyFraction=80
    -XX:+DisableExplicitGC
    We turned on verbose garbage collection and are getting the following output:
    1. Normal operation:
    Application time: 217.4656792 seconds
    3180.905: [GC 3180.906: [ParNew
    Desired survivor size 20119552 bytes, new threshold 4 (max 4)
    - age   1:    2843824 bytes,    2843824 total
    - age   2:    2577128 bytes,    5420952 total
    - age   3:    5742024 bytes,   11162976 total
    - age   4:     625672 bytes,   11788648 total
    : 329531K->15764K(353920K), 0.1484379 secs] 2435799K->2122105K(3392144K), 0.1492386 secs]
    Total time for which application threads were stopped: 0.1886810 seconds
    2. The Problem:
    Application time: 2.8858445 seconds
    5008.433: [GC 5008.434: [ParNew
    Desired survivor size 20119552 bytes, new threshold 2 (max 4)
    - age   1:   15837712 bytes,   15837712 total
    - age   2:   12284416 bytes,   28122128 total
    : 348338K->39296K(353920K), 138.5317715 secs] 2487779K->2192551K(3392144K), 138.5327383 secs]
    Total time for which application threads were stopped: 138.5778558 seconds
    Application time: 2.9764564 seconds
    5149.957: [GC 5149.957: [ParNew
    Desired survivor size 20119552 bytes, new threshold 2 (max 4)
    - age   1:    9483176 bytes,    9483176 total
    - age   2:   14499344 bytes,   23982520 total
    : 353920K->39296K(353920K), 231.5110574 secs] 2507175K->2204546K(3392144K), 231.5121011 secs]
    Total time for which application threads were stopped: 231.5257754 seconds
    Application time: 2.7932907 seconds
    5384.277: [GC 5384.278: [ParNew
    Desired survivor size 20119552 bytes, new threshold 4 (max 4)
    - age   1:   10756376 bytes,   10756376 total
    - age   2:    9135888 bytes,   19892264 total
    : 353920K->28449K(353920K), 256.2065591 secs] 2519170K->2207651K(3392144K), 256.2076388 secs]
    Total time for which application threads were stopped: 256.2221463 seconds
    I can't find any significant differences in the log between fast and long running garbage collections.
    I urgently need help in solving this problem !
    What can I do ?

    After the exciting reply I did get on my question, we did some more investigations on the problem and it seems that we finally found the solution to our problem.
    The number of garbage collection threads used by the virtual machine defaults to the number of cpus of the machine.
    This is ok for small machines or machines where the main load is produced by the java application itself.
    In our environment the main load is not produced by the java application but oracle database processes.
    When java tries to do it's garbage collection using 120 threads (# CPU) on the machine which is already overloaded by non java processes, the thread synchronization seems to produce an exorbitant overhead.
    My theory is that spin locking is used on memory access, causing threads to spin while waiting for other blocking threads not getting cpu because of the heavy load on the system.
    The solution is now to limit the number of garbage collection threads.
    We did that on the first try by setting -XX:ParallelGCThreads=8
    For over one day with heavy load no long GC pauses were experienced any more.

  • Ora-25215 from windows to unix - please help

    I have successfully set up streams replication from unix to windows -- it works beautifully!
    However, when I set up streams with a different set of tables going from windows to unix, I get the propagation error, "ora-25215: user_data type and queue type do not match"
    I have been all over metalink and the internet trying to find a solution or explanation, and there is very little out there. I found a dozen hits on my metalink search on ora-25215 and one of them was "How to resolve ora-25215..." Alas, it really doesn't address a fix for simple streams, it goes into setting up a payload, etc...
    Like I said, my unix to windows works like a charm, but unix to windows doesn't. By the way, my windows is 2k and my unix is solaris 8. Anyone have any ideas for what the problem is?
    Thanks,
    jimmy

    Jimmy,
    Make sure your propagation is configured correctly. It is also possible to get this error in Oracle9iR2 if you use the wrong queue name or schema when configuring propagation.
    Janet

Maybe you are looking for

  • GR Doc# and GR Line Item Number

    Hi All, We have custom defined infocube actually WM-stocks.Now our requirement is to add GR Number and GR line Item Number. can be these be added to Infocube or should we go for ODS? any help from experts? Data has been loaded from generic datasource

  • Layout save option in VA05 not active

    Dear all, I have little problem in VA05, in this report layout save option is not active , can anyone guide how to activate it. Regards, Talwinder

  • .wmv to DVD

    I can't get my .wmv file to come in to iDVD. I am assuming that's because it was created in Windows. Is there a way to convert it to a video file that my iMac will recognize?

  • Connecting lines missing from binary TOC

    Hello! Hope you can help me...I'm using X5. My problem is that I lose the connecting lines between the square/minus boxes in the TOC when I select binary. Is there a way to have both? Thanks much, Deb

  • Standard Development Methodology

    I work as a software development team leader in Oracle platform. We have been using Developer/2000 and Oracle Workgroup server for most of our projects. As a team leader I always tried to implemented a standard software development mothodology in our