9 Replies Latest reply: Jan 9, 2013 12:14 AM by 981655 RSS

    How to execute a procedure with collections parameters in pl/sql?

    981655
      I created a procedure with collection parameter. Can somone help me how to execute a procedure by passing collection parameters.
      Package and procedure creation is successful. But i am getting error while executing the Procedure.

      ORA-06550: line 3, column 19:
      PLS-00222: no function with name 'T_TAB' exists in this scope

      I have given the sample code here. Can someone please help me to resolve thsi issue.

      --------Package spec

      create or replace package pkg_dist is

      TYPE t_tab_num IS TABLE OF NUMBER index by PLS_INTEGER;


      procedure prc_test(a IN t_tab_num,
      b IN t_tab_num,
      c IN OUT t_tab_num);
      end pkg_dist;

      --------Package body

      create or replace package body pkg_dist is

      procedure prc_test(a IN t_tab_num,
      b IN t_tab_num,
      c IN OUT t_tab_num) is


      begin


      IF (a(16) = 0) then
      c(16) := 0;
      c(17) := 0;
      c(18) := 0;
      end if;
      c(15) := a(14) + a(15) + a(16);
      c(16) := b(16) /b(17);
      c(17) := 50;
      c(18) := a(16) * 2;

      end prc_test;
      end pkg_dist;

      --- executeing procedure

      declare
      TYPE t_tab IS TABLE OF NUMBER index by PLS_INTEGER;
      x t_tab := t_tab(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
      y t_tab := t_tab(0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
      z t_tab;
      BEGIN
      pkg_dist.prc_test(x,y,z);
      dbms_output.put_line(z(18));
      END;

      Error :
      --------------------------------------------------------------------------------
      ORA-06550: line 3, column 19:
      PLS-00222: no function with name 'T_TAB' exists in this scope