1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Oracle Varray type with procedure example required

Discussion in 'SQL PL/SQL' started by lakshman123, Nov 30, 2013.

  1. lakshman123

    lakshman123 Guest

    Oracle Varray type with procedure example required
     
  2. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
    in documentation there is all necessary information

    http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/composites.htm#LNPLS357

    Simple example :

    Code (SQL):


    DECLARE
      v_test  sys.odcinumberlist;
      PROCEDURE SHOW (p_nlist IN  sys.odcinumberlist )
      AS
      BEGIN
         FOR z IN 1 .. p_nlist.COUNT
         loop
            dbms_output.put_line ('ODCINUMBERLIST('||z||') = '||p_nlist(z));
         END loop;
      END;
    BEGIN
        -- generated lists number
        SELECT
            level
        bulk collect INTO
            v_test
        FROM dual
        CONNECT BY level < 11;
       
        --shows  elements
        SHOW (v_test);
       
    END;
    /


    SQL>
    ODCINUMBERLIST(1) = 1
    ODCINUMBERLIST(2) = 2
    ODCINUMBERLIST(3) = 3
    ODCINUMBERLIST(4) = 4
    ODCINUMBERLIST(5) = 5
    ODCINUMBERLIST(6) = 6
    ODCINUMBERLIST(7) = 7
    ODCINUMBERLIST(8) = 8
    ODCINUMBERLIST(9) = 9
    ODCINUMBERLIST(10) = 10

     
    you need most to understand an example, to receive necessary information and to solve the problem....