Forum Stats

  • 3,872,674 Users
  • 2,266,455 Discussions
  • 7,911,280 Comments

Discussions

How to pass PL/SQL table type parameter to a SP

Vinod Kumar G M
Vinod Kumar G M Member Posts: 75 Blue Ribbon
edited Apr 5, 2016 11:28AM in SQLとPL/SQL

Hi ,

How can we pas PL/SQL table parameter type  to Stored procedure as input parameter.

Thanks

Vinod

Vinod Kumar G M

Answers

  • 889268
    889268 Member Posts: 27
    edited Mar 17, 2016 7:49AM

    something like this do you need?

    {code}

    set serveroutput on;

    create type complexType as Object

      (c_id number);

     

    create type complexTable is table of complexType;

    create or replace procedure complexProx(v complexTable)

    is

    begin

      for i in 1..v.count

      loop

        dbms_output.put_line(v(i).c_id);

      end loop;

    end;

    declare

      v_id complexTable := complexTable();

    begin 

      v_id.extend;

      for i in 1..10 

      loop

        v_id.extend;

        v_id(i) := complexType(i);

      end loop;

      complexProx(v_id);

    end;

    {code}

    Vinod Kumar G M
  • Vinod Kumar G M
    Vinod Kumar G M Member Posts: 75 Blue Ribbon
    edited Apr 5, 2016 11:28AM
This discussion has been closed.