a collection of uniinitialized. I don't know why

declare 
  -- Local variables here
v_terminalonlooplist WENK.T_GENERAL_NUMLIST;
  j NUMBER :=0;
  i_CustomerData      WENK.PkgCommon.T_CUSTOMERLOOPTYPE;
begin
  -- Test statements here
  --unit test data
--Loop1
  i_CustomerData(1).Cable := 'TM02';
  i_CustomerData(1).Pair := '0291';
  i_CustomerData(1).CentralLocID := 883768;
  i_CustomerData(1).CentralLocName := 'TOROON45';
i_CustomerLoop(1).TerminalDeviceID := 1178050;
  i_CustomerData(1).CPAction := WENK.PkgCommon.c_Add;
 --Loop2 
   i_CustomerData(2).Cable := 'R26';
  i_CustomerData(2).Pair := '1414';
  i_CustomerData(2).CentralLocID := 1178051;
  i_CustomerData(2).CentralLocName := 'TOROON45';
  --i_CustomerLoop(1) .TerminalDeviceID := v_iTID;
  i_CustomerData(2).CPAction := WENK.PkgCommon.c_Add;
  


--Step 1 - Create a list 
  FOR i in reverse 1..i_CustomerLoop.COUNT LOOP
    IF i_CustomerData(i).Termsysid IS NOT NULL  THEN
     
      v_terminalonlooplist(j) :=  i_CustomerData(i).Termsysid;
      j := j+1 ;
    END IF;
  END LOOP;
  
  dbms_output.put_line('   v_terminalonlooplist(1) ' || v_terminalonlooplist(1));  -- <<<< COMPILE ERROR
end;
don't know why I get the compile error. collection of uninitiazlied here.

Is this really the code you are using?
You mix up your i_CustomerLoop with your i_CustomerData?
I don't see where i_CustomerLoop is declared.

I'm in reverse 1.i_CustomerLoop.COUNT LOOP

Perhaps you are looped around the wrong collection? Be it i_CustomerLoop or i_CustomerData?

Initialize your collections on the statement.

Tags: Database

Similar Questions

Maybe you are looking for