DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: call by reference

  1. #1
    Join Date
    Aug 2004
    Location
    Ahmedabad
    Posts
    1

    Post call by reference

    select * from table(cast(max_salary_dept(cursor(select * from departments),cursor(select d.department_name , max(e.salary) from employees e , departments d where e.department_id = d.department_id group by d.department_name) )as output_tbl))


    When i Execute the above query i get following error :

    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "HR.MAX_SALARY_DEPT", line 29

    Kinldy,
    Resolve this error
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2004
    Posts
    162
    Problem is that you declare a variable of type nested table but do not initialise it.

    In any case for sparse collections you would want to use associative array, not nested table. Change declaration of "T_DEP_RECORD" to...

    Code:
    TYPE t_dept_record IS TABLE OF departments%ROWTYPE
      INDEX BY BINARY_INTEGER;

Posting Permissions

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


Click Here to Expand Forum to Full Width