Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Jordan
    Posts
    137

    Unhappy Unanswered: Array as parameter????

    hi all

    I want to pass array of (myrec) as parameter to procedure;
    I did the following:

    1) create type myrec as object ("NO" number(2), "NAME" varchar2(50));

    2) create type MYARR as table of myrec;

    3) I create DB-procedure like this:
    create or replace procedure xxx is
    tmp MYARR;
    begin
    tmp(1).no := 1;
    tmp(1).name := 'toto';
    tmp(2).no := 2;
    tmp(1).no := 'soso';
    -- so later I can pass tmp as parameter to another procedsure
    -- my_procedure(tmp)
    end;

    when I complie this procedure its OK, but when I execute it, this error appear :

    ora-06531 Reference to unintialized coollection

    -------------

    how I can make intilaization for the array??? or solve the problem
    or
    Are there any easy whay to do this???

    thanx in advance

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Try this:
    Code:
    create or replace procedure xxx is
    tmp MYARR := MYARR();
    begin
    tmp.extend(2);
    tmp(1) := MYREC(1,'toto');
    tmp(2) := MYREC(2,'soso');
    -- so later I can pass tmp as parameter to another procedsure
    -- my_procedure(tmp)
    end;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •