Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid reference to variable 'NUMBER'

Shadow123Dec 3 2015 — edited Dec 3 2015

Hi Gurus

I appreciate that if someone help me out, I have the following sample code.

Sample code

SET SERVEROUTPUT ON

DECLARE

   TYPE list_of_numbers_t IS TABLE OF NUMBER;

   l_numbers list_of_numbers_t :=

      list_of_numbers_t (1,2,3);      

BEGIN

  DBMS_OUTPUT.PUT_LINE (l_numbers(1).COUNT);

END;

Error

Error report:

ORA-06550: line 7, column 38:

PLS-00487: Invalid reference to variable 'NUMBER'

ORA-06550: line 7, column 3:

PL/SQL: Statement ignored

06550. 00000 -  "line %s, column %s:\n%s"

*Cause:    Usually a PL/SQL compilation error.

*Action:

I want to refer index 1 of my collection but I'm getting the above error. Can someone help me out to remove this error. Thanks

Regards

Matt


This post has been answered by Frank Kulash on Dec 3 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2015
Added on Dec 3 2015
2 comments
1,815 views