1 Reply Latest reply on Mar 7, 2013 6:00 AM by rp0428

    PLSQL table Count giving NO_DATA_FOUND Error

      Hi Everyone,

      I am having a Associative array define below :

      TYPE SchQryRecTyp IS RECORD (
      load_port port_call.lcn_code%type
      , load_call port_call.call%type
      , dsch_port port_call.lcn_code%type
      , dsch_call port_call.call%type
      , vsl_code port_call.vsl_code%type
      , vsl_name vsl.vsl_name%type
      , voy_code port_call.voy_code%type
      , line_code port_call.line_code%type
      , etd port_call.etd%type
      , eta port_call.eta%type
      , transit_tm number
      , load_area_uid area_master_rly.area_uid%type
      , load_port_qry port_call.lcn_code%type
      , dsch_area_uid area_master_rly.area_uid%type
      , dsch_port_qry port_call.lcn_code%type
      , flag varchar2(4)
      , inact_flg varchar2(1)
      , final_or_doc_lock varchar2(1)

      TYPE SchQry_Tab_Typ IS TABLE OF SchQryRecTyp

      1 ) Now in my code I am polulating the the PLSQL table SchQry_Tab_Typ and
      2) based on that PLSQL table data I am again trying to Fetch some other data.

      But I came accross a problem which i am mentioning below :

      When i am trying to perform the task (2) I am running a Loop i.e.

      IF vroute2.COUNT > 0 THEN
      FOR a IN 1..vroute2.COUNT LOOP
      -- dbms_output.put_line(vroute2(a).vsl_code); **--(But while accessing the value it is giving ORA-01403 - No Data Found )*
      END LOOP;
      END IF;

      But when i changed the loop like this

      IF vroute2.COUNT > 0 THEN
      FOR a IN vroute2.FIRST..vroute2.LAST LOOP
      -- dbms_output.put_line(vroute2(a).vsl_code); **--(Program executed successfully)*
      END LOOP;
      END IF;

      Can anybody help me if they have experienced such problem and the reason for this ?