PL/SQL (MOSC)

MOSC Banner

Receiving a PLS-00487: Invalid reference to variable 'INTEGER' error

edited Jan 31, 2011 1:36AM in PL/SQL (MOSC) 4 commentsAnswered
 All,

I have a PL/SQL procedure that generates an error and I cannot resolve it.  Here is the code:

declare
type name_table is table of integer index by varchar2(30);
name_tab name_table;
v_word varchar2(30);
begin
   v_word := 'Hello';
   name_tab(v_word) := 1;
   dbms_output.put_line(name_tab(v_word));
   if name_tab(v_word).exists then
      name_tab(v_word) := name_tab(v_word) + 1;
   end if;
   dbms_output.put_line(name_tab(v_word));
end;
/

When I run it, here is the error I receive:

   if name_tab(v_word).exists then
                       *
ERROR at line 9:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center