Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-06530: Reference to uninitialized composite Error message?? Have I missed something out

User_OKMG9Nov 25 2015 — edited Nov 25 2015

Trying to understand why I'm getting ORA-06530 message to a simple example below. I'm trying to create a PL/SQL table of values to be stored and then used later in some PL/SQL procedure. But keep on getting this message when trying to added values to the table. Have I missed something out?

/*

drop type Usage_Groups_for_coda_tab1;

drop type Usage_Groups_for_coda_rec1;

CREATE TYPE Usage_Groups_for_coda_rec1 AS

    object

     (Usage_Group_ID                            NUMBER(10),

      Coda_comment                              VARCHAR2(45),

      Amount                                    NUMBER,

      Deduction_amount                          NUMBER)

/

CREATE TYPE Usage_Groups_for_coda_tab1 AS

  TABLE OF Usage_Groups_for_coda_rec1

  /

*/

declare

  p_usage_group_id          USAGE_GROUP.USAGE_GROUP_ID%TYPE := 10412;

  p_coda_comment            CODA_TRANSACTION.CODA_TRANSACTION_COMMENT%TYPE := 046602001;

  p_amount                  CODA_TRANSACTION.TOTAL_CREDIT_AMT%TYPE := 100;

  p_deduction_amount        CODA_TRANSACTION.TOTAL_CREDIT_AMT%TYPE := 0;

  i                              BINARY_INTEGER;

  g_usage_groups_for_coda_tab  Usage_Groups_for_coda_tab1;

BEGIN

   dbms_output.put_line('initilize table ');

   g_usage_groups_for_coda_tab := Usage_Groups_for_coda_tab1();

            

   dbms_output.put_line('added 1 to count of records in table');

   i := g_usage_groups_for_coda_tab.COUNT + 1 ;

        

   dbms_output.put_line('extend : make 1 row in table to be used');      

   g_usage_groups_for_coda_tab.extend;

  

   dbms_output.put_line('added values to g_usage_groups_for_coda_tab ');

         g_usage_groups_for_coda_tab(i).Usage_Group_ID   := p_usage_group_id;

         g_usage_groups_for_coda_tab(i).Coda_comment     := p_coda_comment;

         g_usage_groups_for_coda_tab(i).Amount           := p_amount;

         g_usage_groups_for_coda_tab(i).Deduction_amount := p_deduction_amount;   

        

   dbms_output.put_line('g_usage_groups_for_coda_tab(i).Usage_Group_ID '||g_usage_groups_for_coda_tab(i).Usage_Group_ID||'');

 

END;

This post has been answered by padders on Nov 25 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2015
Added on Nov 25 2015
4 comments
835 views